<html>
<head>
  <title>Evernote Export</title>
  <basefont face="微软雅黑" size="2" />
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <meta name="exporter-version" content="YXBJ Windows/603604 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;"/>
  <style>
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  </style>
</head>
<body>
<a name="1362"/>

<div>
<span bgcolor="#FFFFFF"><div><div><table bgcolor="#D4DDE5" border="0" width="100%"><tr><td><h1>01 - ElasticSearch 前世今生</h1><b>来源网址：</b> <a href="https://www.kuangstudy.com/bbs/1354069127022583809">https://www.kuangstudy.com/bbs/1354069127022583809</a><br/><b>作者：</b> syra-<br/></td></tr></table></div><div><div><div><font style="font-size: 18pt;"><span style="font-size: 18pt; font-weight: bold;">01 - ElasticSearch 前世今生 </span></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><br/></div><div><span style="font-size: 24px; font-weight: bold;">其他博客：</span><a href="https://www.kuangstudy.com/bbs/1354069127022583809" style="font-size: 18pt; font-weight: bold;">https://www.kuangstudy.com/bbs/1354069127022583809</a></div><div><font style="font-size: 18pt;"><br/></font></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">在学习ElasticSearch之前，先简单了解一下</span><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">Lucene</span><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">：</span></font></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px;"><span style="font-size: 18pt; color: rgb(24, 24, 24);">Doug Cutting开发</span></span></font></div></li></ul></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">是</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24);">apache软件基金会</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">4 jakarta项目组的一个子项目</span></font></div></li></ul></div><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">是一个</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24);">开放源代码</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24);">全文检索引擎工具包</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24);">不是一个完整的全文检索引擎，而是一个全文检索引擎的架构</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">，提供了完整的查询引擎和索引引擎，部分</span><a href="https://baike.baidu.com/item/%E6%96%87%E6%9C%AC%E5%88%86%E6%9E%90/11046544" style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: transparent; font-size: 18pt; color: rgb(65, 131, 196);">文本分析</a><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">引擎（英文与德文两种西方语言）</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">当前以及最近几年最受欢迎的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24);">免费Java信息检索程序库</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">。</span></font></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><br/></font></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">Lucene和ElasticSearch的关系：</span></span></div><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 18pt;">ElasticSearch是基于Lucene 做了一下封装和增强</span></span></font></div></li></ul><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><span style="font-size: 18pt; color: rgb(255, 0, 0); font-weight: bold;">一、ElasticSearch 概述</span></font></div><div><font style="font-size: 18pt;"><br/></font></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">官网：</span><a href="https://www.elastic.co/cn/downloads/elasticsearch" style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: transparent; font-size: 18pt; color: rgb(65, 131, 196); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">https://www.elastic.co/cn/downloads/elasticsearch</a></font></div></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">Elaticsearch</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">，简称为es，es是一个开源的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">高扩展</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">分布式全文检索引擎</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">，它可以近乎</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">实时的存储</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">、</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">检索数据;</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">本身扩展性很好，可以扩展到上百台服务器，处理PB级别(大数据时代）的数据。es也使用java开发并使用Lucene作为其核心来实现所有索引和搜索的功能，但是它的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">目的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">是</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(77, 206, 29); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">通过简单的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 18pt; color: rgb(77, 206, 29); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">RESTful API</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(77, 206, 29); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">来隐藏Lucene的复杂性，从而让全文搜索变得简单</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">。</span></font></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">据国际权威的数据库产品评测机构DB Engines的统计，在2016年1月，ElasticSearch已超过Solr等，成为</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">排名第一的搜索引擎类应用</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">。</span></font></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><h3 style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="font-size: 18pt; color: rgb(102, 102, 102); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">历史</span></span></h3></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">多年前，一个叫做Shay Banon的刚结婚不久的失业开发者，由于妻子要去伦敦学习厨师，他便跟着也去了。在他找工作的过程中，为了给妻子构建一个食谱的搜索引擎，他开始构建一个早期版本的Lucene。</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">直接基于Lucene工作会比较困难，所以Shay开始抽象Lucene代码以便lava程序员可以在应用中添加搜索功能。他发布了他的第一个开源项目，叫做“Compass”。</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">后来Shay找到一份工作，这份工作处在高性能和内存数据网格的分布式环境中，因此高性能的、实时的、分布式的搜索引擎也是理所当然需要的。然后他决定重写Compass库使其成为一个独立的服务叫做Elasticsearch。</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">第一个公开版本出现在2010年2月，在那之后Elasticsearch已经成为Github上最受欢迎的项目之一，代码贡献者超过300人。一家主营Elasticsearch的公司就此成立，他们一边提供商业支持一边开发新功能，不过Elasticsearch将永远开源且对所有人可用。</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">Shay的妻子依旧等待着她的食谱搜索…..</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 18pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">谁在使用：</span></span></div><p style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></p><ul><li><div><span style="font-size: 18pt;">1、维基百科,类似百度百科，全文检索,高亮,搜索推荐/2</span></div></li><li><div><span style="font-size: 18pt;">2、The Guardian (国外新闻网站) ,类似搜狐新闻,用户行为日志(点击,浏览,收藏,评论) +社交网络数据(对某某新闻的相关看法) ,数据分析,给到每篇新闻文章的作者,让他知道他的文章的公众反馈(好,坏,热门，垃圾,鄙视，崇拜)</span></div></li><li><div><span style="font-size: 18pt;">3、Stack Overflow (国外的程序异常讨论论坛) , IT问题,程序的报错,提交上去,有人会跟你讨论和回答,全文检索,搜索相关问题和答案,程序报错了,就会将报错信息粘贴到里面去,搜索有没有对应的答案</span></div></li><li><div><span style="font-size: 18pt;">4、GitHub (开源代码管理),搜索 上千亿行代码</span></div></li><li><div><span style="font-size: 18pt;">5、电商网站,检索商品</span></div></li><li><div><span style="font-size: 18pt;">6、日志数据分析, logstash采集日志, ES进行复杂的数据分析, </span><span style="box-sizing: border-box; border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">ELK技术, elasticsearch+logstash+kibana</span></div></li><li><div><span style="font-size: 18pt;">7、商品价格监控网站,用户设定某商品的价格阈值,当低于该阈值的时候,发送通知消息给用户,比如说订阅牙膏的监控,如果高露洁牙膏的家庭套装低于50块钱,就通知我,我就去买</span></div></li><li><div><span style="font-size: 18pt;">8、BI系统,商业智能, Business Intelligence。比如说有个大型商场集团，BI ,分析一下某某区域最近3年的用户消费 金额的趋势以及用户群体的组成构成,产出相关的数张报表, **区,最近3年,每年消费金额呈现100%的增长,而且用户群体85%是高级白领，开-个新商场。ES执行数据分析和挖掘, Kibana进行数据可视化</span></div></li><li><div><span style="font-size: 18pt;">9、国内:站内搜索(电商,招聘,门户,等等),IT系统搜索(OA,CRM,ERP,等等),数据分析(ES热门</span><span style="font-size: 18pt; color: unset; font-family: unset;">的一一个使用场景)</span></div></li></ul><h2 style="box-sizing: border-box; padding: 8px 10px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: rgb(204, 229, 255); border-radius: 3px; position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: rgb(204, 229, 255); border-radius: 3px; position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="background-color: rgb(204, 229, 255); font-size: 18pt; color: rgb(84, 88, 87); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.425;">ES和Solr</span></span></h2><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">ElasticSearch简介</span></span></h3><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">Elasticsearch是一个</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">实时分布式搜索和分析引擎</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">。 它让你以前所未有的速度处理大数据成为可能。</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">它用于</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px;"><span style="font-size: 18pt; color: rgb(77, 206, 29); font-weight: bold;">全文搜索、结构化搜索、分析</span></span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">以及将这三者混合使用:</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 18pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">维基百科</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">使用Elasticsearch提供</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">全文搜索</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">并</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">高亮关键字</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">,以及输入</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">实时搜索</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">(search-asyou-type)和</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">搜索纠错</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">(did-you-mean)等搜索建议功能。</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 18pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">英国卫报</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">使用Elasticsearch结合用户日志和社交网络数据提供给他们的编辑以实时的反馈,以便及时了解公众对新发表的文章的回应。</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 18pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">StackOverflow</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">结合全文搜索与地理位置查询,以及more-like-this功能来找到相关的问题和答案。</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 18pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">Github</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">使用Elasticsearch检索1300亿行的代码。</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">但是Elasticsearch不仅用于大型企业，它还让像</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 18pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">DataDog</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">以及</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 18pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">Klout</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">这样的创业公司将最初的想法变成可扩展的解决方案。</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 18pt;">Elasticsearch可以在你的笔记本上运行,也可以在数以百计的服务器上处理PB级别的数据。</span></span></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div><span style="font-size: 18pt;">Elasticsearch是一个基于Apache Lucene(TM)的开源搜索引擎。无论在开源还是专有领域, Lucene可被认为是迄今为止最先进、性能最好的、功能最全的搜索引擎库。</span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">但是,</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">Lucene只是一个库</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">。 想要使用它,你必须使用Java来作为开发语言并将其直接集成到你的应用中,更糟糕的是, Lucene非常复杂,你需要深入了解检索的相关知识来理解它是如何工作的。</span></font></div></li></ul></div><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">Elasticsearch也使用Java开发并使用Lucene作为其核心来实现所有索引和搜索的功能,但是它的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(77, 206, 29); font-weight: bold;">目的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt; color: rgb(77, 206, 29);">是通过简单的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(77, 206, 29); font-weight: bold;">RESTful API</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt; color: rgb(77, 206, 29);">来隐藏Lucene的复杂性,从而让全文搜索变得简单。</span></font></div></li></ul><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">Solr简介</span></span></h3><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">Solr是Apache下的一个顶级开源项目,采用Java开发,它是</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">基于Lucene的全文搜索服务器</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">。Solr提供了比Lucene更为</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">丰富的查询语言</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">,同时实现了</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">可配置</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">、</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">可扩展</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">，并</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">对索引、搜索性能进行了优化</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">Solr可以</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">独立运行</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">,运行在</span></font> <span style="font-size: 18pt; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">J</span><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">etty. Tomcat等这些Selrvlet容器中 , Solr 索引的实现方法很简单,<span style="font-size: 18pt; color: rgb(77, 206, 29);">用POST方法向Solr服务器发送一个描述Field及其内容的XML文档, Solr根据xml文档</span></span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px;"><span style="font-size: 18pt; color: rgb(77, 206, 29); font-weight: bold;">添加、删除、更新</span></span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;"><span style="font-size: 18pt; color: rgb(77, 206, 29);">索引</span>。Solr 搜索只需要发送HTTP GET请求,然后对Solr返回xml、json等格式的查询结果进行解析,组织页面布局。</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">Solr不提供构建UI的功能,</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">Solr提供了一个管理界面,通过管理界面可以查询Solr的配置和运行情况。</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 18pt;">Solr是基于lucene开发企业级搜索服务器,实际上就是封装了lucene.</span></span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 18pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">Solr是一个独立的企业级搜索应用服务器,它</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 18pt; color: rgb(24, 24, 24); font-weight: bold;">对外提供类似于Web-service的API接口</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 18pt;">。用户可以通过http请求,向搜索引擎服务器提交-定格式的文件,生成索引;也可以通过提出查找请求,并得到返回结果。</span></font></div></li></ul><div><font style="font-size: 18pt;"><br/></font></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">ElasticSearch与Solr比较</span></span></h3><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">当单纯的对已有数据进行搜索时，Solr更快</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;"><br/></span></div><div style="text-align: center;"><span style="font-size: 18pt;"><img src="./ElasticSearch/Image.png" type="image/png" data-filename="Image.png" width="942"/></span></div><div style="text-align: center;"><span style="font-size: 18pt;"><br/></span></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">当实时建立索引时，Solr会产生io阻塞，查询性能较差，ElasticSearch具有明显的优势</font></div></div><div style="text-align: center;"><span style="font-size: 18pt;"><img src="./ElasticSearch/Image [1].png" type="image/png" data-filename="Image.png" width="913"/></span></div><div><font style="font-size: 18pt;"><br/></font></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="font-size: 16pt;">随着数据量的增加，Solr的搜索效率会变得更低，而ElasticSearch却没有明显的变化</span></div></div><div style="text-align: center;"><span style="font-size: 18pt;"><img src="./ElasticSearch/Image [2].png" type="image/png" data-filename="Image.png" width="965"/></span></div><div><font style="font-size: 18pt;"><br/></font></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">转变我们的搜索基础设施后从Solr ElasticSearch，我们看见一个即时~ 50x提高搜索性能！</font></div></div><div style="text-align: center;"><span style="font-size: 18pt;"><img src="./ElasticSearch/Image [3].png" type="image/png" data-filename="Image.png" width="1098"/></span></div><div><font style="font-size: 18pt;"><br/></font></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">总结</span></span></h4><p style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></p><ul><li><div><span style="font-size: 16pt;">1、</span><span style="box-sizing: border-box; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">es</span><span style="font-size: 16pt;">基本是</span><span style="box-sizing: border-box; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">开箱即用</span><span style="font-size: 16pt;">(解压就可以用!) ,非常简单。Solr安装略微复杂一丢丢!</span></div></li><li><div><span style="font-size: 16pt;">2、</span><span style="box-sizing: border-box; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">Solr 利用Zookeeper进行分布式管理</span><span style="font-size: 16pt;">,而</span><span style="box-sizing: border-box; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">Elasticsearch&lt;mark&gt;自身带有分布式协调管理功能&lt;/mark&gt;。</span></div></li><li><div><span style="font-size: 16pt;">3、Solr 支持更多格式的数据,比如JSON、XML、 CSV ,而</span><span style="box-sizing: border-box; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">Elasticsearch仅支持json文件格式</span><span style="font-size: 16pt;">。</span></div></li><li><div><span style="font-size: 16pt;">4、Solr 官方提供的功能更多,而Elasticsearch本身更注重于核心功能，高级功能多有第三方插件提供，例如图形化界面需要kibana友好支撑</span></div></li><li><div style="margin-top: 1em; margin-bottom: 1em;"><font style="font-size: 16pt;"><span style="font-size: 16pt;-en-paragraph:true;">5、</span></font></div></li><ul><li><div style="margin-top: 1em; margin-bottom: 1em;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;-en-paragraph:true;">Solr 查询快,但更新索引时慢(即插入删除慢)</span><span style="font-size: 16pt;-en-paragraph:true;"> </span><span style="font-size: 16pt;-en-paragraph:true;">，用于电商等查询多的应用</span></font></div></li><li><div style="margin-top: 1em; margin-bottom: 1em;"><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; color: rgb(24, 24, 24); font-family: unset; font-weight: bold;">ES建立索引快(即查询慢)</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: unset; font-family: unset;"> </span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: unset; font-family: unset;">，即</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; color: rgb(24, 24, 24); font-family: unset; font-weight: bold;">实时性查询快</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: unset; font-family: unset;">，用于facebook新浪等搜索。</span></div></li><li><div style="margin-top: 1em; margin-bottom: 1em;"><span style="font-size: 16pt; color: unset; font-family: unset;">Solr是传统搜索应用的有力解决方案，但Elasticsearch更适用于新兴的实时搜索应用。</span></div></li></ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">6、Solr比较成熟，有一个更大，更成熟的用户、开发和贡献者社区，而Elasticsearch相对开发维护者较少,更新太快,学习使用成本较高。</span></span></div></li></ul><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 18pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div></div><div><br/></div></div><br/><div><table bgcolor="#D4DDE5" border="0" width="100%"><tr><td><h1>02 - ElasticSearch 安装和基本配置</h1><b>来源网址：</b> <a href="https://www.kuangstudy.com/bbs/1354069127022583809">https://www.kuangstudy.com/bbs/1354069127022583809</a><br/><b>作者：</b> syra-<br/></td></tr></table></div><div><div><div><div><span style="font-size: 18pt; font-weight: bold;">02 - ElasticSearch 安装和基本配置 </span></div><div><span style="font-size: 18pt;"><br/></span></div><div><font style="font-size: 16pt;"><br/></font></div><div><span style="font-size: 21.3333px;"><span style="font-size: 21.3333px; color: rgb(255, 0, 0); font-weight: bold;">一、安装ElasticSearch Windows版本</span></span></div><div><span style="font-size: 21.3333px;"><br/></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238);"><span style="background-color: rgb(246, 246, 246);"><span style="background-color: rgb(246, 246, 246); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal;">JDK8，最低要求</span></span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">使用Java开发，必须保证</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal;">ElasticSearch</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">的版本与Java的核心jar包版本对应！（Java环境保证没错）</span></font></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">这里在windows上进行安装</span></span></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">Windows下安装</span></span></h3></blockquote><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">1、安装</span></span></h4><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">下载地址：https://www.elastic.co/cn/downloads/</font></div><div><font style="font-size: 16pt;">历史版本下载：https://www.elastic.co/cn/downloads/past-releases/</font></div><div><font style="font-size: 16pt;">解压即可（尽量将ElasticSearch相关工具放在统一目录下）</font></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br/></div></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">2、熟悉目录</span></span></h4><div style="text-align: center;"><span style="font-size: 16pt;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;; font-weight: bold;"><img src="./ElasticSearch/Image [4].png" type="image/png" data-filename="Image.png" width="634"/></span></span></div><div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">bin 启动文件目录</font></span></div><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">config 配置文件目录</font></span></div><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    1og4j2 日志配置文件</font></span></div><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    jvm.options java 虚拟机相关的配置(默认启动占1g内存，内容不够需要自己调整)</font></span></div><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    elasticsearch.ym1 elasticsearch 的配置文件! 默认9200端口!跨域!</font></span></div><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">1ib</font></span></div><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    相关jar包</font></span></div><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">modules 功能模块目录</font></span></div><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">plugins 插件目录</font></span></div><div><span style="box-sizing: border-box; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; position: relative; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    ik分词器</font></span></div></div><div><font style="font-size: 16pt;"><br/></font></div><div><span style="font-size: 16pt;">配置ElasticSearch的jvm内存大小，修改 </span><span style="font-size: 16pt;">jvm.options</span></div><div style="text-align: center;"><img src="./ElasticSearch/Image [5].png" type="image/png" data-filename="Image.png"/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">3、启动</span></span></span></h4><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">一定要检查自己的java环境是否配置好</span></span></div><div><font style="font-size: 16pt;"><br/></font></div><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;;"><img src="./ElasticSearch/Image [6].png" type="image/png" data-filename="Image.png" width="840"/></span></div><div><font style="font-size: 16pt;"><br/></font></div><div style="text-align: center;"><span style="color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;;"><img src="./ElasticSearch/Image [7].png" type="image/png" data-filename="Image.png"/></span></div><div style="text-align: left;"><span style="font-size: 16pt;">即使是单机。ElasticSearch也是集群形式的，且集群名称默认是elasticsearch</span></div><div><font style="font-size: 16pt;"><br/></font></div><div><span style="font-size: 21.3333px;"><span style="font-size: 21.3333px; color: rgb(255, 0, 0); font-weight: bold;">二、ElasticSearch-Head插件安装</span></span></div><ol><li><div><span style="font-size: 21.3333px;">采用Google浏览器插件安装</span></div></li><li><div><span style="font-size: 21.3333px;">采用本地web项目安装</span></div></li></ol><ul><ul><li><div><span style="font-size: 21.3333px;">需要配置ElasticSearch的跨域，不然不能访问。</span><span style="font-size: 16pt;">elasticsearch.yml</span></div></li></ul></ul><div style="text-align: center;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [8].png" type="image/png" data-filename="Image.png"/></span></div><div style="text-align: center;"><br/></div><div style="text-align: center;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [9].png" type="image/png" data-filename="Image.png" width="1067"/></span></div><div><span style="font-size: 16pt;">这里我用的插件。比较方便，能够实时的看到elasticsearch的状态。</span></div><div style="text-align: center;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [10].png" type="image/png" data-filename="Image.png" width="806"/></span></div><div style="text-align: center;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [11].png" type="image/png" data-filename="Image.png" width="866"/></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">如何理解上图：</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">索引 可以看做 “数据库”</span></span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">类型 可以看做 “表”</span></span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">文档 可以看做 “库中的数据（表中的行）”</span></span></div></li></ul></ul></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div><span style="font-size: 16pt;">这个head，我们只是把它</span><span style="box-sizing: border-box; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">当做可视化数据展示工具</span><span style="font-size: 16pt;">，之后</span><span style="box-sizing: border-box; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">所有的查询都在kibana中进行，</span><span style="font-size: 16pt; color: unset; font-family: unset;">因为不支持json格式化，不方便</span></div></div><div><font style="font-size: 16pt;"><br/></font></div><div><span style="font-size: 21.3333px; color: rgb(255, 0, 0); font-weight: bold;">三、ElasticSearch的可视化工具Kibana安装</span></div><div><span style="font-size: 21.3333px;"><br/></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">Kibana是一个针对ElasticSearch的开源分析及可视化平台,用来搜索、查看交互存储在Elasticsearch索引中的数据。使用Kibana ,可以通过各种图表进行高级数据分析及展示。Kibana让海量数据更容易理解。它操作简单,基于浏览器的用户界面可以快速创建仪表板( dashboard )实时显示Elasticsearch查询动态。设置Kibana非常简单。无需编码或者额外的基础架构,几分钟内就可以完成Kibana安装并启动Elasticsearch索引监测。</span></span></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">1、下载地址:</span></span></h4><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">下载的版本需要与ElasticSearch版本对应</span></span></div></blockquote><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">https://www.elastic.co/cn/downloads/</font></div><div><font style="font-size: 16pt;">历史版本下载：https://www.elastic.co/cn/downloads/past-releases/</font></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">2、安装</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">解压即可（尽量将ElasticSearch相关工具放在统一目录下）</span></span></div><div style="text-align: center;"><span style="font-size: 16pt;"><span style="font-size: 16pt; color: rgb(255, 0, 0); font-weight: bold;"><img src="./ElasticSearch/Image [12].png" type="image/png" data-filename="Image.png"/></span></span></div><div style="text-align: left;"><span style="font-size: 16pt;">修改config/kibana.yml，进行kibana汉化</span></div><div style="text-align: center;"><img src="./ElasticSearch/Image [13].png" type="image/png" data-filename="Image.png"/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; font-size: 1.12em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; font-size: 1.12em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">3、启动</span></h4><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 14px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 11pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;; font-variant-caps: normal; font-variant-ligatures: normal;"><img src="./ElasticSearch/Image [14].png" type="image/png" data-filename="Image.png" width="857"/></span></div><div style="text-align: left; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">浏览器访问localhost:5601即可</span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 14px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 11pt;"><img src="./ElasticSearch/Image [15].png" type="image/png" data-filename="Image.png"/></span></div><div><font style="font-size: 16pt;"><br/></font></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">了解ELK</span></span></h3><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div><span style="font-size: 16pt;">ELK是</span><span style="box-sizing: border-box; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">Elasticsearch、Logstash、 Kibana三大开源框架首字母大写简称</span><span style="font-size: 16pt;">。市面上也被成为Elastic Stack。</span></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><ul><li><div><span style="font-size: 16pt;">其中Elasticsearch是一个基于Lucene、分布式、通过Restful方式进行交互的近实时搜索平台框架。</span></div></li><ul><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">像类似百度、谷歌这种大数据全文搜索引擎的场景都可以使用Elasticsearch作为底层支持框架，可见Elasticsearch提供的搜索能力确实强大,市面上很多时候我们简称Elasticsearch为es。</span></span></div></li></ul></ul></ul></ul></div><ul><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">Logstash是ELK的中央数据流引擎,用于从不同目标(文件/数据存储/MQ )收集的不同格式数据,经过过滤后支持输出到不同目的地(文件/MQ/redis/elasticsearch/kafka等)。</span></span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">Kibana可以将elasticsearch的数据通过友好的页面展示出来 ,提供实时分析的功能。</span></span></div></li></ul></ul></div><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">市面上很多开发只要提到ELK能够一致说出它是一个日志分析架构技术栈总称 ,但实际上ELK不仅仅适用于日志分析,它还可以支持其它任何数据分析和收集的场景,日志分析和收集只是更具有代表性。并非唯一性。</span></span></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">收集清洗数据(</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 0, 102); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">Logstash</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">)</span> <span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">==&gt;</span> <span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">搜索、存储(</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 0, 102); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">ElasticSearch</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">)</span> <span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">==&gt;</span> <span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">展示(</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 0, 102); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">Kibana</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">)</span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 14px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 11pt;"><img src="./ElasticSearch/Image [16].png" type="image/png" data-filename="Image.png"/></span></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div></div></div><div><br/></div></div><br/><div><table bgcolor="#D4DDE5" border="0" width="100%"><tr><td><h1>03 - ElasticSearch 基本语法命令</h1><b>来源网址：</b> <a href="https://www.kuangstudy.com/bbs/1354069127022583809">https://www.kuangstudy.com/bbs/1354069127022583809</a><br/><b>作者：</b> syra-<br/></td></tr></table></div><div><div><div><div><div><span style="font-size: 18pt; font-weight: bold;"> 03 - ElasticSearch 基本语法命令 </span></div><div><br/></div><div><font style="font-size: 16pt;"><span style="font-size: 16pt; color: rgb(255, 0, 0); font-weight: bold;">一、ElasticSearch 概述</span></font></div><div><font style="font-size: 18pt;"><br/></font></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><h2 style="box-sizing: border-box; padding: 8px 10px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: rgb(204, 229, 255); border-radius: 3px; position: relative; border-bottom: 1px solid rgb(238, 238, 238);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: rgb(204, 229, 255); border-radius: 3px; position: relative; border-bottom: 1px solid rgb(238, 238, 238);"><span style="background-color: rgb(204, 229, 255); font-size: 16pt; color: rgb(84, 88, 87); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.425;">概述</span></span></h2></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">1、索引（ElasticSearch）</span></span></div><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: unset; font-family: unset; font-variant-caps: normal; font-variant-ligatures: normal;">包多个分片</span></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">2、字段类型（映射）</span></span></div><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: unset; font-family: unset; font-variant-caps: normal; font-variant-ligatures: normal;">字段类型映射（字段是整型，还是字符型…）</span></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">3、文档</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">4、分片（Lucene索引，倒排索引）</span></span></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">ElasticSearch是面向文档，关系型数据库和ElasticSearch客观对比！一切都是JSON！</span></span></div></blockquote><table style="border-collapse: collapse; min-width: 100%;"><colgroup><col style="width: 523px;"></col><col style="width: 523px;"></col></colgroup><tbody style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none;"><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(248, 248, 248);"><td style="box-sizing: border-box; list-style: none; text-align: inherit; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">Relational DB</span></div></td><td style="box-sizing: border-box; list-style: none; text-align: inherit; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">ElasticSearch</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(255, 255, 255);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">数据库（database）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">索引（indices）</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(248, 248, 248);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">表（tables）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">types \&lt;慢慢会被弃用!&gt;</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(255, 255, 255);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">行（rows）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">documents</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(248, 248, 248);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">字段（columns）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 523px; padding: 8px;"><div style="text-align: center;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">fields</span></div></td></tr></tbody></table><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">elasticsearch（集群）</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">中可以包含多个</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">索引（数据库）</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">每个索引中可以包含多个</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">类型（表）</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">每个类型下又包含多个</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">文档（行）</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">每个文档中又包含多个</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">字段（列）</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">。</span></font></div></li></ul><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">物理设计:</span></span></h3><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">elasticsearch在后台把</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">每个索引划分成多个分片</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">，每分分片可以在集群中的不同服务器间迁移，</span></font><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">一个人就是一个集群! ，即</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">启动的ElasticSearch服务，默认就是一个集群，且默认集群名为elasticsearch。</span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;; font-variant-caps: normal; font-variant-ligatures: normal;"><img src="./ElasticSearch/Image [17].png" type="image/png" data-filename="Image.png"/></span></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">逻辑设计:</span></span></h3><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">一个索引类型中，包含多个文档，比如说文档1，文档2。当我们索引一篇文档时，可以通过这样的顺序找到它：索引 =&gt; 类型 =&gt; 文档ID ，通过这个组合我们就能索引到某个具体的文档。 注意：ID不必是整数，实际上它是个字符串。</span></span></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><h4 style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">文档（”行“）</span></span></h4></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">之前说elasticsearch是面向文档的，那么就意味着</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">索引和搜索数据的最小单位是文档</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">，elasticsearch中，文档有几个重要属性:</span></font></div><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">自我包含，一篇文档同时包含字段和对应的值，也就是同时包含key:value !</span></span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">可以是层次型的，一个文档中包含自文档，复杂的逻辑实体就是这么来的! {就是一个json对象 ! fastjson进行自动转换 !}</span></span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">灵活的结构，文档不依赖预先定义的模式，我们知道关系型数据库中，要提前定义字段才能使用，在elasticsearch中，对于字段是非常灵活的，有时候,我们可以忽略该字段，或者动态的添加一个新的字段。</span></span></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">尽管我们可以随意的新增或者忽略某个字段，但是，每个字段的类型非常重要，比如一个年龄字段类型，可以是字符串也可以是整形。因为elasticsearch会保存字段和类型之间的映射及其他的设置。这种映射具体到每个映射的每种类型，这也是为什么在elasticsearch中，类型有时候也称为映射类型。</span></span></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><h4 style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">类型（“表”）</span></span></h4></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">类型是文档的逻辑容器，就像关系型数据库一样，表格是行的容器。类型中对于字段的定义称为映射，比如name映射为字符串类型。我们说文档是无模式的，它们不需要拥有映射中所定义的所有字段，比如新增一个字段，那么elasticsearch是怎么做的呢?</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">elasticsearch会自动的将新字段加入映射，但是这个字段的不确定它是什么类型，elasticsearch就开始猜，如果这个值是18，那么elasticsearch会认为它是整形。但是elasticsearch也可能猜不对，所以最安全的方式就是提前定义好所需要的映射，这点跟关系型数据库殊途同归了，先定义好字段，然后再使用，别整什么幺蛾子。</span></span></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><h4 style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative;"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">索引（“库”）</span></span></h4></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">索引是映射类型的容器， elasticsearch中的索引是一个非常大的文档集合。 索引存储了映射类型的字段和其他设置。然后它们被存储到了各个分片上了。我们来研究下分片是如何工作的。</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">物理设计：节点和分片 如何工作</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">创建新索引</span></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><img src="./ElasticSearch/Image [18].png" type="image/png" data-filename="Image.png"/></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">一个集群至少有一个节点，而一个节点就是一个elasricsearch进程，节点可以有多个索引默认的，如果你创建索引，那么索引将会有个5个分片(primary shard ,又称主分片)构成的，每一个主分片会有一个副本(replica shard，又称复制分片)</span></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><img src="./ElasticSearch/Image [19].png" type="image/png" data-filename="Image.png"/></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">上图是一个有3个节点的集群，可以看到主分片和对应的复制分片都不会在同一个节点内，这样有利于某个节点挂掉了，数据也不至于丢失。实际上，</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">一个分片是一个Lucene索引（</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt;"><span style="font-size: 16pt; color: rgb(77, 206, 29); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">一个ElasticSearch索引包含多个Lucene索引</span></span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">）</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">，</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">一个包含倒排索引的文件目录，倒排索引的结构使得elasticsearch在不扫描全部文档的情况下，就能告诉你哪些文档包含特定的关键字</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">。不过，等等，倒排索引是什么鬼?</span></font></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">倒排索引（Lucene索引底层）</span></span></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">简单说就是 按（文章关键字，对应的文档\&lt;0个或多个\&gt;）形式建立索引，根据关键字就可直接查询对应的文档（含关键字的），无需查询每一个文档，如下图</span></span></div></blockquote><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><img src="./ElasticSearch/Image [20].png" type="image/png" data-filename="Image.png"/></div><div style="box-sizing: border-box; outline: 0px; margin: 0px 0px 16px; padding: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><font style="font-size: 16pt;"><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; line-height: 26px;"> </span><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; line-height: 26px;"> 正向索引（forward index），反向索引（inverted index）更熟悉的名字是倒排索引。</span></font></div><div style="text-align: left; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="background-color: rgb(255, 255, 255);"><span style="font-size: 16pt; box-sizing: border-box; outline: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; line-height: 26px;">     在</span><span style="font-size: 16pt; box-sizing: border-box; outline: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 26px;">搜索引擎</span><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; background-color: rgb(255, 255, 255); color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; line-height: 26px;">中每个文件都对应一个文件ID，文件</span><span style="background-color: rgb(255, 255, 255); font-size: 16pt; color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; line-height: 26px;">内容被表示为一系列</span></span><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="background-color: rgb(255, 255, 255); font-size: 16pt; color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; line-height: 26px;">关键词的集合（实际上在搜索引擎索引库中，关键词也已经转换为关键词ID）。例如“文档1”经过分词，提取了20个关键词，每个关键词都会记录它在文档中的出现次数和出现位置</span></span><span style="font-size: 16px; box-sizing: border-box; outline: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; line-height: 26px;">。</span></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><img src="./ElasticSearch/Image [21].png" type="image/png" data-filename="Image.png"/></div><div style="text-align: left; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">搜索引擎会将正向索引重新构建为倒排索引</span><span style="letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); font-size: 16pt; color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal;">，即把文件ID对应到关键词的映射转换为</span><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); font-size: 16pt; color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">关键词到文件ID的映射</span><span style="letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(77, 77, 77); font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-variant-caps: normal; font-variant-ligatures: normal;">，每个关键词都对应着一系列的文件，这些文件中都出现这个关键词。</span></font></div><div style="text-align: center;"><img src="./ElasticSearch/Image [22].png" type="image/png" data-filename="Image.png"/></div></div><div style="text-align: left;"><br/></div><div><span style="font-size: 16pt; color: rgb(255, 0, 0); font-weight: bold;">二、IK分词器</span></div><div><font style="font-size: 16pt;"><br/></font></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">K分词器：中文分词器</span></span></div></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">分词：即把一段中文或者别的划分成一个个的关键字，我们在搜索时候会把自己的信息进行分词，会把数据库中或者索引库中的数据进行分词，然后进行一一个匹配操作，</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">默认的中文分词是将每个字看成一个词</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">（不使用用IK分词器的情况下），比如“我爱狂神”会被分为”我”，”爱”，”狂”，”神” ，这显然是不符合要求的，所以我们需要安装中文分词器ik来解决这个问题。</span></font></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">IK提供了两个分词算法</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">:</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal;">ik_smart</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">和</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal;">ik_max_word</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">,其中</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal;">ik_smart</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">为</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">最少切分</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">,</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal;">ik_max_word</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">为</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">最细粒度划分</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">!</span></font></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">1、下载</span></span></h3><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">版本要与ElasticSearch版本对应</span></span></div></blockquote><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">下载地址：https://github.com/medcl/elasticsearch-analysis-ik/releases</font></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br/></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">2、安装</span></span></h3><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">ik文件夹自行创建</span></span></div></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">加压即可（但是我们需要解压到ElasticSearch的plugins目录ik文件夹下）</span></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;; font-variant-caps: normal; font-variant-ligatures: normal;"><img src="./ElasticSearch/Image [23].png" type="image/png" data-filename="Image.png"/></span></div><div style="text-align: left; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; font-size: 1.3em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; font-size: 1.3em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">3、重启ElasticSearch</span></h3><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">加载了IK分词器</span></span></div></blockquote><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 14px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 11pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;; font-variant-caps: normal; font-variant-ligatures: normal;"><img src="./ElasticSearch/Image [24].png" type="image/png" data-filename="Image.png"/></span></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; font-size: 1.3em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; font-size: 1.3em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">4、使用</span><span style="box-sizing: border-box; font-size: 1.3em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;"> </span><span style="box-sizing: border-box; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">ElasticSearch安装补录/bin/elasticsearch-plugin</span><span style="box-sizing: border-box; font-size: 1.3em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;"> </span><span style="box-sizing: border-box; font-size: 1.3em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">可以查看插件</span></h3><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: left;"><br/></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">E:\ElasticSearch\elasticsearch-7.6.1\bin&gt;elasticsearch-plugin list</font></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: left;"><br/></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><img src="./ElasticSearch/Image [25].png" type="image/png" data-filename="Image.png"/></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; font-size: 1.3em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; font-size: 1.3em; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">5、使用kibana测试</span></h3><div style="text-align: left; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 14px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 14px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal;">ik_smart</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 14px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">：最少切分</span></span></div><div style="text-align: left; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; font-size: 14px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal;">ik_max_word</span><span style="font-size: 14px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">：最细粒度划分（穷尽词库的可能）</span></div><div style="text-align: left; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div>GET _analyze</div><div>{</div><div>&quot;analyzer&quot;: &quot;ik_smart&quot;,</div><div>&quot;text&quot;: &quot;我们生在红旗下，长在春风里。人民有信仰，国家有力量。目光所致皆为华夏，五星闪耀皆为信仰。&quot;</div><div>}</div><div><br/></div><div>GET _analyze</div><div>{</div><div>&quot;analyzer&quot;: &quot;ik_max_word&quot;,</div><div>&quot;text&quot;: &quot;我们生在红旗下，长在春风里。人民有信仰，国家有力量。目光所致皆为华夏，五星闪耀皆为信仰。&quot;</div><div>}</div></div><div><br/></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></div><div><img src="./ElasticSearch/Image [26].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><div><span style="letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(248, 248, 248);"><span style="background-color: rgb(248, 248, 248); font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">从上面看，感觉分词都比较正常，但是大多数，分词都</span><span style="background-color: rgb(248, 248, 248); font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">满足不了我们的想法，</span></span> <font style="font-size: 16pt;"><span style="letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(248, 248, 248); font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">那么，我们需要手动将该词添加到分词器的词典当中</span></font></div><div><br/></div><div><img src="./ElasticSearch/Image [27].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><div><br/></div><div><br/></div><div><span style="font-size: 16pt; color: rgb(255, 0, 0); font-weight: bold;">三、Restful风格说明</span></div><div><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-weight: bold;">一种软件架构风格</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">,而不是标准,只是提供了一组设计原则和约束条件。它主要用于客户端和服务器交互类的软件。基于这个风格设计的软件可以</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-weight: bold;">更简洁</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">，</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-weight: bold;">更有层次</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">，</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-weight: bold;">更易于实现缓存</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif;">等机制。</span></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">基本Rest命令说明：</span></span></h3><table style="border-collapse: collapse; min-width: 100%;"><colgroup><col style="width: 348px;"></col><col style="width: 348px;"></col><col style="width: 348px;"></col></colgroup><tbody style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none;"><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(248, 248, 248);"><td style="box-sizing: border-box; list-style: none; text-align: center; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">method</span></div></td><td style="box-sizing: border-box; list-style: none; text-align: center; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">url地址</span></div></td><td style="box-sizing: border-box; list-style: none; text-align: center; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">描述</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(255, 255, 255);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">PUT（创建,修改）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">localhost:9200/索引名称/类型名称/文档id</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">创建文档（指定文档id）</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(248, 248, 248);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">POST（创建）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">localhost:9200/索引名称/类型名称</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">创建文档（随机文档id）</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(255, 255, 255);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">POST（修改）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">localhost:9200/索引名称/类型名称/文档id/_update</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">修改文档</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(248, 248, 248);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">DELETE（删除）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">localhost:9200/索引名称/类型名称/文档id</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">删除文档</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(255, 255, 255);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">GET（查询）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">localhost:9200/索引名称/类型名称/文档id</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">查询文档通过文档ID</span></div></td></tr><tr style="box-sizing: border-box; padding: 0px; list-style: none; background-color: rgb(248, 248, 248);"><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">POST（查询）</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">localhost:9200/索引名称/类型名称/文档id/_search</span></div></td><td style="box-sizing: border-box; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center; border: 1px solid rgb(238, 238, 238); width: 348px; padding: 8px;"><div style="font-size: 14px;"><span style="font-size: 14px; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">查询所有数据</span></div></td></tr></tbody></table><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 18pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">测试</span></span></h3><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">1、创建一个索引，添加</span></span></h4><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">PUT /test1/type1/1</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;name&quot;:&quot;狂神说&quot;,</font></div><div><font style="font-size: 16pt;">  &quot;age&quot;:&quot;18&quot;</font></div><div><font style="font-size: 16pt;">}</font></div></div><div><img src="./ElasticSearch/Image [28].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><div style="text-align: center;"><img src="./ElasticSearch/Image [29].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">2、字段数据类型</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div><span style="font-size: 16pt;">字符串类型</span></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><ul><li><div><span style="font-size: 16pt;">text、</span><span style="box-sizing: border-box; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">keyword</span></span></div></li><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">text：支持分词，全文检索,支持模糊、精确查询,不支持聚合,排序操作;text类型的最大支持的字符长度无限制,适合大字段存储；</span></span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">keyword：不进行分词，直接索引、支持模糊、支持精确匹配，支持聚合、排序操作。keyword类型的最大支持的长度为——32766个UTF-8类型的字符,可以通过设置ignore_above指定自持字符长度，超过给定长度后的数据将不被索引，无法通过term精确匹配检索返回结果。</span></span></div></li></ul></ul></ul></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div><span style="font-size: 16pt;">数值型</span></div></li><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">long、Integer、short、byte、double、float、</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">half float</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">、</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">scaled float</span></font></div></li></ul></ul></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div><span style="font-size: 16pt;">日期类型</span></div></li><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">date</span></span></div></li></ul></ul></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div><span style="font-size: 16pt;">te布尔类型</span></div></li><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">boolean</span></span></div></li></ul></ul></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div><span style="font-size: 16pt;">二进制类型</span></div></li><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">binary</span></span></div></li></ul></ul></div><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">等等…</span></span></div></li></ul><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">3、指定字段的类型（使用PUT）</span></span></h4><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">类似于建库（建立索引和字段对应类型），也可看做规则的建立</span></span></div></blockquote><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">PUT /test3</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;mappings&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;properties&quot;: {</font></div><div><font style="font-size: 16pt;">      &quot;name&quot;:{</font></div><div><font style="font-size: 16pt;">        &quot;type&quot;: &quot;text&quot;</font></div><div><font style="font-size: 16pt;">      },</font></div><div><font style="font-size: 16pt;">      &quot;age&quot;:{</font></div><div><font style="font-size: 16pt;">        &quot;type&quot;: &quot;long&quot;</font></div><div><font style="font-size: 16pt;">      },</font></div><div><font style="font-size: 16pt;">      &quot;birthday&quot;:{</font></div><div><font style="font-size: 16pt;">        &quot;type&quot;: &quot;date&quot;</font></div><div><font style="font-size: 16pt;">      }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div></div><div><br/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">4、获取3建立的规则</span></span></h4><div><span style="font-size: 11pt;"><span style="font-size: 11pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;; font-weight: bold;"><img src="./ElasticSearch/Image [30].png" type="image/png" data-filename="Image.png"/></span></span></div><div><br/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">5、默认类型（_doc）</span></span></h4><div><img src="./ElasticSearch/Image [31].png" type="image/png" data-filename="Image.png"/></div><div><span style="letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(248, 248, 248);"><span style="background-color: rgb(248, 248, 248); font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">如果自己的文档字段没有被指定，那么ElasticSearch就会给我们默认配置字段类型</span></span></div><div><br/></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">扩展：通过</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal;">get _cat/</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">可以获取ElasticSearch的当前的很多信息！</span></font></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">GET _cat/indices</font></div><div><font style="font-size: 16pt;">GET _cat/aliases</font></div><div><font style="font-size: 16pt;">GET _cat/allocation</font></div><div><font style="font-size: 16pt;">GET _cat/count</font></div><div><font style="font-size: 16pt;">GET _cat/fielddata</font></div><div><font style="font-size: 16pt;">GET _cat/health</font></div><div><font style="font-size: 16pt;">GET _cat/indices</font></div><div><font style="font-size: 16pt;">GET _cat/master</font></div><div><font style="font-size: 16pt;">GET _cat/nodeattrs</font></div><div><font style="font-size: 16pt;">GET _cat/nodes</font></div><div><font style="font-size: 16pt;">GET _cat/pending_tasks</font></div><div><font style="font-size: 16pt;">GET _cat/plugins</font></div><div><font style="font-size: 16pt;">GET _cat/recovery</font></div><div><font style="font-size: 16pt;">GET _cat/repositories</font></div><div><font style="font-size: 16pt;">GET _cat/segments</font></div><div><font style="font-size: 16pt;">GET _cat/shards</font></div><div><font style="font-size: 16pt;">GET _cat/snapshots</font></div><div><font style="font-size: 16pt;">GET _cat/tasks</font></div><div><font style="font-size: 16pt;">GET _cat/templates</font></div><div><font style="font-size: 16pt;">GET _cat/thread_pool</font></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><br/></div><div><img src="./ElasticSearch/Image [32].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">6、修改</span></span></h4><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">两种方案</span></span></div></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">①旧的（使用put覆盖原来的值）</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">版本+1（_version）</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">但是如果漏掉某个字段没有写，那么更新是没有写的字段 ，会消失</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><br/></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">#修改方式</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET /test3/_doc/1</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">#修改方式一  ： 使用PUT进行覆盖修改， 版本增加 1     rest:    put  /index/_doc/id</font></div><div><font style="font-size: 16pt;">PUT /test3/_doc/1</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;name&quot;:&quot;狂神说123&quot;,</font></div><div><font style="font-size: 16pt;">  &quot;age&quot;:18,</font></div><div><font style="font-size: 16pt;">  &quot;birthday&quot;:&quot;1997-06-06&quot;</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">#修改方式   :  使用POSt进行修改，指定要修改的字段    rest:   post /index/_doc/id/_update</font></div><div><font style="font-size: 16pt;">POST /test3/_doc/1/_update</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;doc&quot;:{</font></div><div><font style="font-size: 16pt;">    &quot;name&quot;:&quot;法外狂徒罗翔&quot;</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><br/></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 14px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 11pt;"><img src="./ElasticSearch/Image [33].png" type="image/png" data-filename="Image.png" width="1093"/></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 14px; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 11pt;"><img src="./ElasticSearch/Image [34].png" type="image/png" data-filename="Image.png" width="1088"/></span></div><div><br/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">7、删除</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><br/></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">GET /test1</font></div><div><font style="font-size: 16pt;">DELETE /test1</font></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><br/></div><div><img src="./ElasticSearch/Image [35].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><div><br/></div><div><br/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">8、查询（简单条件）</span></span></h4><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">#简单查询</font></div><div><font style="font-size: 16pt;">GET /zzu/user/2    </font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET /zzu/user/_search?q=name:花    rest：  get  /index/type/_search?q=field=value</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET /zzu/user/_search?q=name:江</font></div></div><div><img src="./ElasticSearch/Image [36].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">9、复杂查询</span></span></h4><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">zzu索引中的内容</span></span></div></blockquote><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;"># 查询所有文档</font></div><div><font style="font-size: 16pt;">GET /zzu/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;match_all&quot;: {}</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div></div><div style="text-align: center;"><br/></div><div><img src="./ElasticSearch/Image [37].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><div style="text-align: center;"><img src="./ElasticSearch/Image [38].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">①查询匹配</span></span></h5><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">match</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">：匹配（会使用分词器解析（先分析文档，然后进行查询））</span></font></div></li></ul></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">_source</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">：过滤字段</span></font></div></li></ul></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">sort</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">：排序</span></font></div></li></ul></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">form</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">、</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">size</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">分页</span></font></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">#根据ik分词器进行字段值匹配     </font></div><div><font style="font-size: 16pt;">GET /zzu/user/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;:{</font></div><div><font style="font-size: 16pt;">    &quot;match&quot;:{</font></div><div><font style="font-size: 16pt;">      &quot;name&quot;:&quot;江&quot;</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"># 展示文档中的那些字段类型 _source</font></div><div><font style="font-size: 16pt;">GET /zzu/user/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;:{</font></div><div><font style="font-size: 16pt;">    &quot;match&quot;:{</font></div><div><font style="font-size: 16pt;">      &quot;name&quot;:&quot;江&quot;</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  },</font></div><div><font style="font-size: 16pt;">  &quot;_source&quot;: [&quot;name&quot;,&quot;desc&quot;]</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">#根据年龄进行排序  sort ： asc | desc 正序  | 降序  ； 分页查询操作  from ： 从那个开始查  size ： 查询几个</font></div><div><font style="font-size: 16pt;">GET /zzu/user/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;:{</font></div><div><font style="font-size: 16pt;">    &quot;match_all&quot;: {}</font></div><div><font style="font-size: 16pt;">  },</font></div><div><font style="font-size: 16pt;">    &quot;sort&quot;: [</font></div><div><font style="font-size: 16pt;">    {</font></div><div><font style="font-size: 16pt;">      &quot;age&quot;: {</font></div><div><font style="font-size: 16pt;">        &quot;order&quot;: &quot;asc&quot;</font></div><div><font style="font-size: 16pt;">      }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  ],</font></div><div><font style="font-size: 16pt;">  &quot;from&quot;: 0,</font></div><div><font style="font-size: 16pt;">  &quot;size&quot;: 2</font></div><div><font style="font-size: 16pt;">}</font></div></div><div><br/></div></div><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [39].png" type="image/png" data-filename="Image.png"/></span></div></div><div><br/></div><div><img src="./ElasticSearch/Image [40].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><div><font style="font-size: 16pt;"><br/></font></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">②多条件查询（bool）</span></span></h5><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">must</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">相当于</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">and</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">should</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">相当于</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">or</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">must_not</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">相当于</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">not (... and ...)</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">filter</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">过滤</span></font></div></li></ul><div><br/></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">#查询条件并列       must ==  and  </font></div><div><font style="font-size: 16pt;">GET /zzu/user/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;bool&quot;: {</font></div><div><font style="font-size: 16pt;">      &quot;must&quot;: [</font></div><div><font style="font-size: 16pt;">        {</font></div><div><font style="font-size: 16pt;">          &quot;match&quot;: {</font></div><div><font style="font-size: 16pt;">            &quot;name&quot;: &quot;江&quot;</font></div><div><font style="font-size: 16pt;">          }</font></div><div><font style="font-size: 16pt;">        },{</font></div><div><font style="font-size: 16pt;">          &quot;match&quot;: {</font></div><div><font style="font-size: 16pt;">            &quot;age&quot;: 30</font></div><div><font style="font-size: 16pt;">          }</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">      ]</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">#查询条件或者      should == or</font></div><div><font style="font-size: 16pt;">GET /zzu/user/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;bool&quot;: {</font></div><div><font style="font-size: 16pt;">      &quot;should&quot;: [</font></div><div><font style="font-size: 16pt;">        {</font></div><div><font style="font-size: 16pt;">          &quot;match&quot;: {</font></div><div><font style="font-size: 16pt;">            &quot;name&quot;: &quot;江&quot;</font></div><div><font style="font-size: 16pt;">          }</font></div><div><font style="font-size: 16pt;">        },{</font></div><div><font style="font-size: 16pt;">          &quot;match&quot;: {</font></div><div><font style="font-size: 16pt;">            &quot;age&quot;: 18</font></div><div><font style="font-size: 16pt;">          }</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">      ]</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">#查询条件不等于      must_not == not</font></div><div><font style="font-size: 16pt;">GET /zzu/user/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;bool&quot;: {</font></div><div><font style="font-size: 16pt;">      &quot;must_not&quot;: [</font></div><div><font style="font-size: 16pt;">       {</font></div><div><font style="font-size: 16pt;">          &quot;match&quot;: {</font></div><div><font style="font-size: 16pt;">            &quot;age&quot;: 18</font></div><div><font style="font-size: 16pt;">          }</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">      ]</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">#  &gt;  gt 大于  |    &gt;=  gte   大于等于 |    &lt;  lt   小于  |     &lt;=   lte  小于等于</font></div><div><font style="font-size: 16pt;">GET /zzu/user/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;bool&quot;: {</font></div><div><font style="font-size: 16pt;">      &quot;must_not&quot;: [</font></div><div><font style="font-size: 16pt;">       {</font></div><div><font style="font-size: 16pt;">          &quot;match&quot;: {</font></div><div><font style="font-size: 16pt;">            &quot;age&quot;: 23</font></div><div><font style="font-size: 16pt;">          }</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">      ],</font></div><div><font style="font-size: 16pt;">      &quot;filter&quot;: {</font></div><div><font style="font-size: 16pt;">        &quot;range&quot;: {</font></div><div><font style="font-size: 16pt;">          &quot;age&quot;: {</font></div><div><font style="font-size: 16pt;">            &quot;gte&quot;: 20,</font></div><div><font style="font-size: 16pt;">            &quot;lte&quot;: 30</font></div><div><font style="font-size: 16pt;">          }</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">      }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div></div><div><br/></div><div><br/></div><div style="text-align: center;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [41].png" type="image/png" data-filename="Image.png" width="983"/></span></div><div style="text-align: center;"><span style="font-size: 16pt;">图  Must并列</span></div><div><font style="font-size: 16pt;"><br/></font></div><div style="text-align: center;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [42].png" type="image/png" data-filename="Image.png" width="992"/></span></div><div style="text-align: center;"><span style="font-size: 16pt;">图 should或者</span></div><div style="text-align: center;"><font style="font-size: 16pt;"><br/></font></div><div style="text-align: center;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [43].png" type="image/png" data-filename="Image.png" width="989"/></span></div><div style="text-align: center;"><span style="font-size: 16pt;">图 must_not 不等于</span></div><div style="text-align: center;"><font style="font-size: 16pt;"><br/></font></div><div style="text-align: center;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [44].png" type="image/png" data-filename="Image.png" width="1003"/></span></div><div style="text-align: center;"><span style="font-size: 16pt;">图 filter过滤</span></div><div style="text-align: center;"><br/></div><div><br/></div><div><font style="font-size: 16pt;"><br/></font></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">③匹配数组</span></span></h5><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">貌似不能与其它字段一起使用</span></span></div></li></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">可以多关键字查（空格隔开）— 匹配字段也是符合的</span></span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">match</span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: unset; font-family: unset;"> </span><span style="font-size: 16pt; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: unset; font-family: unset;">会使用分词器解析（先分析文档，然后进行查询）</span></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: unset; font-family: unset;">搜词</span></div></li></ul><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [45].png" type="image/png" data-filename="Image.png" width="1174"/></span></div></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">④精确查询</span></span></h5><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">term</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">直接通过 倒排索引 指定</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">词条</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">查询</span></font></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">适合查询 number、date、keyword ，不适合text</span></span></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;"># term 直接查询精确地,不会使用分词器</font></div><div><font style="font-size: 16pt;"># 精确查询（必须全部都有，而且不可分，即按一个完整的词查询</font></div><div><font style="font-size: 16pt;"># term 直接通过 倒排索引 指定的词条 进行精确查找的</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"># match  会使用分词器解析</font></div><div><font style="font-size: 16pt;">#精确查询</font></div><div><font style="font-size: 16pt;">PUT testdb/_doc/2</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;t1&quot;:&quot;11&quot;,</font></div><div><font style="font-size: 16pt;">  &quot;t2&quot;:&quot;2021-05-08&quot;</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;">PUT testdb/_doc/4</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;t1&quot;:&quot;22&quot;,</font></div><div><font style="font-size: 16pt;">  &quot;t2&quot;:&quot;2021-06-08&quot;</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;">PUT testdb/_doc/3</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;t1&quot;:&quot;33&quot;,</font></div><div><font style="font-size: 16pt;">  &quot;t2&quot;:&quot;2021-08-08&quot;</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET testdb/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;bool&quot;: {</font></div><div><font style="font-size: 16pt;">      &quot;should&quot;: [</font></div><div><font style="font-size: 16pt;">        {</font></div><div><font style="font-size: 16pt;">          &quot;term&quot;: {</font></div><div><font style="font-size: 16pt;">              &quot;t1&quot;: &quot;22&quot;</font></div><div><font style="font-size: 16pt;">            }</font></div><div><font style="font-size: 16pt;">          },</font></div><div><font style="font-size: 16pt;">          {</font></div><div><font style="font-size: 16pt;">             &quot;term&quot;: {</font></div><div><font style="font-size: 16pt;">              &quot;t1&quot;: &quot;33&quot;</font></div><div><font style="font-size: 16pt;">             }</font></div><div><font style="font-size: 16pt;">          }</font></div><div><font style="font-size: 16pt;">      ]</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;">GET testdb/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;from&quot;: 0,</font></div><div><font style="font-size: 16pt;">  &quot;size&quot;: 20</font></div><div><font style="font-size: 16pt;">}</font></div></div><div><br/></div><div><img src="./ElasticSearch/Image [46].png" type="image/png" data-filename="Image.png"/></div><div><br/></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">⑤text和keyword</span></span></h5><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div><span style="font-size: 16pt;">text：</span></div></li><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">支持分词</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">，</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">全文检索</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">、支持模糊、精确查询,不支持聚合,排序操作;</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">text类型的最大支持的字符长度无限制,适合大字段存储；</span></span></div></li></ul></ul></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><ul><li><div><span style="font-size: 16pt;">keyword：</span></div></li><ul><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">不进行分词</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">，</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">直接索引</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">、支持模糊、支持精确匹配，支持聚合、排序操作。</span></font></div></li><li><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">keyword类型的最大支持的长度为——32766个UTF-8类型的字符,可以通过设置ignore_above指定自持字符长度，超过给定长度后的数据将不被索引，</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 20px; font-size: 16pt; color: rgb(24, 24, 24); font-weight: bold;">无法通过term精确匹配检索返回结果</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">。</span></font></div></li></ul></ul><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><br/></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;"># text</font></div><div><font style="font-size: 16pt;"># keyword</font></div><div><font style="font-size: 16pt;">PUT testdb</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;mappings&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;properties&quot;: {</font></div><div><font style="font-size: 16pt;">      &quot;name&quot;:{</font></div><div><font style="font-size: 16pt;">        &quot;type&quot;: &quot;text&quot;</font></div><div><font style="font-size: 16pt;">      },</font></div><div><font style="font-size: 16pt;">      &quot;desc&quot;:{</font></div><div><font style="font-size: 16pt;">        &quot;type&quot;: &quot;keyword&quot;</font></div><div><font style="font-size: 16pt;">      }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET testdb</font></div><div><br/></div><div><font style="font-size: 16pt;">PUT /testdb/_doc/1</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;name&quot;:&quot;狂神说Java name&quot;,</font></div><div><font style="font-size: 16pt;">  &quot;desc&quot;:&quot;狂神说Java desc&quot;</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;">PUT /testdb/_doc/2</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;name&quot;:&quot;狂神说Java name&quot;,</font></div><div><font style="font-size: 16pt;">  &quot;desc&quot;:&quot;狂神说Java desc2&quot;</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET testdb/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;term&quot;: {</font></div><div><font style="font-size: 16pt;">     &quot;name&quot;: &quot;狂&quot;</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET testdb/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;term&quot;: {</font></div><div><font style="font-size: 16pt;">     &quot;desc&quot;: &quot;狂&quot;</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET testdb/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;term&quot;: {</font></div><div><font style="font-size: 16pt;">     &quot;desc&quot;: &quot;狂神说Java desc&quot;</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"># text  </font></div><div><font style="font-size: 16pt;"># keyword</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET _analyze</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;analyzer&quot;: &quot;keyword&quot;,</font></div><div><font style="font-size: 16pt;">  &quot;text&quot;: &quot;狂神说Java name&quot;</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET _analyze</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">  &quot;analyzer&quot;: &quot;standard&quot;,</font></div><div><font style="font-size: 16pt;">  &quot;text&quot;: &quot;狂神说Java name&quot;</font></div><div><font style="font-size: 16pt;">}</font></div></div><div><br/></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [47].png" type="image/png" data-filename="Image.png"/></span></div></div><div style="text-align: center;"><span style="font-size: 21.3333px;">图 创建索引并指定字段类型</span></div><div style="text-align: center;"><span style="font-size: 21.3333px;"><br/></span></div><div><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [48].png" type="image/png" data-filename="Image.png"/></span></div><div style="text-align: center;"><span style="font-size: 16pt;">图 查询字段类型text结果，可以使用分词器进行匹配</span></div><div><font style="font-size: 16pt;"><br/></font></div><div style="text-align: center;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [49].png" type="image/png" data-filename="Image.png"/></span></div><div style="text-align: center;"><span style="font-size: 16pt;">图  字段类型keyword，模糊查询结果为空</span></div><div><br/></div><div><br/></div><div><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [50].png" type="image/png" data-filename="Image.png"/></span></div><div style="text-align: center;"><span style="font-size: 16pt;">图 分词器对不同字段类型进行分析</span></div><div><font style="font-size: 16pt;"><br/></font></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">⑥高亮查询</span></span></h5><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">#文档高亮查询， 后续所搜索模拟京东搜索效果一样，使用java-api</font></div><div><font style="font-size: 16pt;">GET zzu/user/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">&quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">  &quot;match&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;name&quot;: &quot;花&quot;</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">},</font></div><div><font style="font-size: 16pt;">  &quot;highlight&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;fields&quot;: {</font></div><div><font style="font-size: 16pt;">      &quot;name&quot;:{</font></div><div><font style="font-size: 16pt;">        </font></div><div><font style="font-size: 16pt;">      }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">GET zzu/user/_search</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">&quot;query&quot;: {</font></div><div><font style="font-size: 16pt;">  &quot;match&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;name&quot;: &quot;花&quot;</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">},</font></div><div><font style="font-size: 16pt;">  &quot;highlight&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;pre_tags&quot;: &quot;&lt;p class='key' style='color=red' &gt;&quot;,</font></div><div><font style="font-size: 16pt;">    &quot;post_tags&quot;: &quot;&lt;/p&gt;&quot;,</font></div><div><font style="font-size: 16pt;">    &quot;fields&quot;: {</font></div><div><font style="font-size: 16pt;">      &quot;name&quot;:{</font></div><div><font style="font-size: 16pt;">        </font></div><div><font style="font-size: 16pt;">      }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">  }</font></div><div><font style="font-size: 16pt;">}</font></div></div><div><br/></div><div><img src="./ElasticSearch/Image [51].png" type="image/png" data-filename="Image.png"/></div><div style="text-align: center;"><span style="font-size: 16pt;">图 字段高亮</span></div><div><br/></div><div>附：全部命令</div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div>#ik 分词器  ， ik_smart | ik_max_word</div><div>GET _analyze</div><div>{</div><div>  &quot;analyzer&quot;: &quot;ik_smart&quot;,</div><div>  &quot;text&quot;: &quot;超级喜欢狂神说Java&quot;</div><div>}</div><div><br/></div><div><br/></div><div>GET _analyze</div><div>{</div><div>  &quot;analyzer&quot;: &quot;ik_max_word&quot;,</div><div>  &quot;text&quot;: &quot;超级喜欢狂神说Java&quot;</div><div>}</div><div><br/></div><div><br/></div><div>#创建索引  和  插入一条文档  并且  类型是type1  rest:    put /index/type/id {&quot;field&quot;:&quot;value&quot;}</div><div>PUT /test1/type1/1</div><div>{</div><div>  &quot;name&quot;:&quot;狂神说&quot;,</div><div>  &quot;age&quot;:&quot;18&quot;</div><div>}</div><div><br/></div><div><br/></div><div>GET test1</div><div>#创建索引 并 指定文档中的字段类型     rest:    put /index {&quot;mappings&quot;:{&quot;properties&quot;:{&quot;field&quot;:&quot;type&quot;}}}</div><div>PUT /test3</div><div>{</div><div>  &quot;mappings&quot;: {</div><div>    &quot;properties&quot;: {</div><div>      &quot;name&quot;:{</div><div>        &quot;type&quot;: &quot;text&quot;</div><div>      },</div><div>      &quot;age&quot;:{</div><div>        &quot;type&quot;: &quot;long&quot;</div><div>      },</div><div>      &quot;birthday&quot;:{</div><div>        &quot;type&quot;: &quot;date&quot;</div><div>      }</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div>GET /test3</div><div><br/></div><div><br/></div><div>#创建索引 并 默认匹配字段类型       rest:     put  /index/_doc/id</div><div>PUT /test4/_doc/1</div><div>{</div><div>  &quot;name&quot;:&quot;狂神说&quot;,</div><div>  &quot;age&quot;:18,</div><div>  &quot;birthday&quot;:&quot;1997-06-06&quot;</div><div>}</div><div><br/></div><div><br/></div><div>GET test4</div><div><br/></div><div><br/></div><div>#获取es的相关信息</div><div>GET _cat/indices</div><div>GET _cat/aliases</div><div>GET _cat/allocation</div><div>GET _cat/count</div><div>GET _cat/fielddata</div><div>GET _cat/health</div><div>GET _cat/indices</div><div>GET _cat/master</div><div>GET _cat/nodeattrs</div><div>GET _cat/nodes</div><div>GET _cat/pending_tasks</div><div>GET _cat/plugins</div><div>GET _cat/recovery</div><div>GET _cat/repositories</div><div>GET _cat/segments</div><div>GET _cat/shards</div><div>GET _cat/snapshots</div><div>GET _cat/tasks</div><div>GET _cat/templates</div><div>GET _cat/thread_pool</div><div><br/></div><div><br/></div><div>#修改方式</div><div><br/></div><div><br/></div><div>GET /test3/_doc/1</div><div><br/></div><div><br/></div><div>#修改方式一  ： 使用PUT进行覆盖修改， 版本增加 1     rest:    put  /index/_doc/id</div><div>PUT /test3/_doc/1</div><div>{</div><div>  &quot;name&quot;:&quot;狂神说123&quot;,</div><div>  &quot;age&quot;:18,</div><div>  &quot;birthday&quot;:&quot;1997-06-06&quot;</div><div>}</div><div><br/></div><div><br/></div><div>#修改方式   :  使用POSt进行修改，指定要修改的字段    rest:   post /index/_doc/id/_update</div><div>POST /test3/_doc/1/_update</div><div>{</div><div>  &quot;doc&quot;:{</div><div>    &quot;name&quot;:&quot;法外狂徒罗翔123&quot;</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div># 删除索引   rest :  delete /index</div><div>DELETE /test1</div><div><br/></div><div>#=======================查============================</div><div>PUT /zzu/user/1</div><div>{</div><div>  &quot;name&quot;:&quot;扈三娘&quot;,</div><div>  &quot;age&quot;:18,</div><div>   &quot;desc&quot;:&quot;一顿操作猛如虎&quot;,</div><div>   &quot;tags&quot;:[&quot;母老虎&quot;,&quot;母夜叉&quot;]</div><div>}</div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div>PUT /zzu/user/2</div><div>{</div><div>  &quot;name&quot;:&quot;宋江&quot;,</div><div>  &quot;age&quot;:30,</div><div>   &quot;desc&quot;:&quot;心在山东身在吴，飘蓬江海谩嗟吁。他时若遂凌云志，敢笑黄巢不丈夫。&quot;,</div><div>   &quot;tags&quot;:[&quot;及时雨&quot;,&quot;相声&quot;]</div><div>}</div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div>PUT /zzu/user/3</div><div>{</div><div>  &quot;name&quot;:&quot;花荣&quot;,</div><div>  &quot;age&quot;:23,</div><div>   &quot;desc&quot;:&quot;打工仔&quot;,</div><div>   &quot;tags&quot;:[&quot;小李广&quot;,&quot;射箭&quot;]</div><div>}</div><div><br/></div><div><br/></div><div>#简单查询</div><div>GET /zzu/user/2    </div><div>GET /zzu/user/_search?q=name:花    rest：  get  /index/type/_search?q=field=value</div><div><br/></div><div><br/></div><div>GET /zzu/user/_search?q=name:江</div><div><br/></div><div><br/></div><div># 查询所有文档</div><div>GET /zzu/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;match_all&quot;: {}</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div>#根据ik分词器进行字段值匹配     </div><div>GET /zzu/user/_search</div><div>{</div><div>  &quot;query&quot;:{</div><div>    &quot;match&quot;:{</div><div>      &quot;name&quot;:&quot;江&quot;</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div># 展示文档中的那些字段类型 _source</div><div>GET /zzu/user/_search</div><div>{</div><div>  &quot;query&quot;:{</div><div>    &quot;match&quot;:{</div><div>      &quot;name&quot;:&quot;江&quot;</div><div>    }</div><div>  },</div><div>  &quot;_source&quot;: [&quot;name&quot;,&quot;desc&quot;]</div><div>}</div><div><br/></div><div><br/></div><div>#根据年龄进行排序  sort ： asc | desc 正序  | 降序  ； 分页查询操作  from ： 从那个开始查  size ： 查询几个</div><div>GET /zzu/user/_search</div><div>{</div><div>  &quot;query&quot;:{</div><div>    &quot;match_all&quot;: {}</div><div>  },</div><div>    &quot;sort&quot;: [</div><div>    {</div><div>      &quot;age&quot;: {</div><div>        &quot;order&quot;: &quot;asc&quot;</div><div>      }</div><div>    }</div><div>  ],</div><div>  &quot;from&quot;: 0,</div><div>  &quot;size&quot;: 2</div><div>}</div><div><br/></div><div><br/></div><div>#查询条件并列       must ==  and  </div><div>GET /zzu/user/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;bool&quot;: {</div><div>      &quot;must&quot;: [</div><div>        {</div><div>          &quot;match&quot;: {</div><div>            &quot;name&quot;: &quot;江&quot;</div><div>          }</div><div>        },{</div><div>          &quot;match&quot;: {</div><div>            &quot;age&quot;: 30</div><div>          }</div><div>        }</div><div>      ]</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div>#查询条件或者      should == or</div><div>GET /zzu/user/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;bool&quot;: {</div><div>      &quot;should&quot;: [</div><div>        {</div><div>          &quot;match&quot;: {</div><div>            &quot;name&quot;: &quot;江&quot;</div><div>          }</div><div>        },{</div><div>          &quot;match&quot;: {</div><div>            &quot;age&quot;: 18</div><div>          }</div><div>        }</div><div>      ]</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div>#查询条件不等于      must_not == not</div><div><br/></div><div><br/></div><div>GET /zzu/user/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;bool&quot;: {</div><div>      &quot;must_not&quot;: [</div><div>       {</div><div>          &quot;match&quot;: {</div><div>            &quot;age&quot;: 18</div><div>          }</div><div>        }</div><div>      ]</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div>#  &gt;  gt 大于  |    &gt;=  gte   大于等于 |    &lt;  lt   小于  |     &lt;=   lte  小于等于</div><div>GET /zzu/user/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;bool&quot;: {</div><div>      &quot;must_not&quot;: [</div><div>       {</div><div>          &quot;match&quot;: {</div><div>            &quot;age&quot;: 23</div><div>          }</div><div>        }</div><div>      ],</div><div>      &quot;filter&quot;: {</div><div>        &quot;range&quot;: {</div><div>          &quot;age&quot;: {</div><div>            &quot;gte&quot;: 20,</div><div>            &quot;lte&quot;: 30</div><div>          }</div><div>        }</div><div>      }</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div># 多个查询条件 空格隔开即可</div><div># 匹配数组 貌似不能与其它字段一起使用</div><div># 可以多关键字查（空格隔开）</div><div># match 会使用分词器解析（先分析文档，然后进行查询）</div><div><br/></div><div><br/></div><div>GET /zzu/user/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;match&quot;: {</div><div>      &quot;tags&quot;: &quot;雨  小&quot;</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div># term 直接查询精确地,不会使用分词器</div><div># 精确查询（必须全部都有，而且不可分，即按一个完整的词查询</div><div># term 直接通过 倒排索引 指定的词条 进行精确查找的</div><div><br/></div><div><br/></div><div># match  会使用分词器解析</div><div>#精确查询</div><div>PUT testdb/_doc/2</div><div>{</div><div>  &quot;t1&quot;:&quot;11&quot;,</div><div>  &quot;t2&quot;:&quot;2021-05-08&quot;</div><div>}</div><div>PUT testdb/_doc/4</div><div>{</div><div>  &quot;t1&quot;:&quot;22&quot;,</div><div>  &quot;t2&quot;:&quot;2021-06-08&quot;</div><div>}</div><div>PUT testdb/_doc/3</div><div>{</div><div>  &quot;t1&quot;:&quot;33&quot;,</div><div>  &quot;t2&quot;:&quot;2021-08-08&quot;</div><div>}</div><div><br/></div><div><br/></div><div>GET testdb/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;bool&quot;: {</div><div>      &quot;should&quot;: [</div><div>        {</div><div>          &quot;term&quot;: {</div><div>              &quot;t1&quot;: &quot;22&quot;</div><div>            }</div><div>          },</div><div>          {</div><div>             &quot;term&quot;: {</div><div>              &quot;t1&quot;: &quot;33&quot;</div><div>             }</div><div>          }</div><div>      ]</div><div>    }</div><div>  }</div><div>}</div><div>GET testdb/_search</div><div>{</div><div>  &quot;from&quot;: 0,</div><div>  &quot;size&quot;: 20</div><div>}</div><div><br/></div><div><br/></div><div># text</div><div># keyword</div><div><br/></div><div><br/></div><div>PUT testdb</div><div>{</div><div>  &quot;mappings&quot;: {</div><div>    &quot;properties&quot;: {</div><div>      &quot;name&quot;:{</div><div>        &quot;type&quot;: &quot;text&quot;</div><div>      },</div><div>      &quot;desc&quot;:{</div><div>        &quot;type&quot;: &quot;keyword&quot;</div><div>      }</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div>GET testdb</div><div><br/></div><div><br/></div><div>PUT /testdb/_doc/1</div><div>{</div><div>  &quot;name&quot;:&quot;狂神说Java name&quot;,</div><div>  &quot;desc&quot;:&quot;狂神说Java desc&quot;</div><div>}</div><div>PUT /testdb/_doc/2</div><div>{</div><div>  &quot;name&quot;:&quot;狂神说Java name&quot;,</div><div>  &quot;desc&quot;:&quot;狂神说Java desc2&quot;</div><div>}</div><div><br/></div><div><br/></div><div>GET testdb/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;term&quot;: {</div><div>     &quot;name&quot;: &quot;狂&quot;</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div>GET testdb/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;term&quot;: {</div><div>     &quot;desc&quot;: &quot;狂&quot;</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div>GET testdb/_search</div><div>{</div><div>  &quot;query&quot;: {</div><div>    &quot;term&quot;: {</div><div>     &quot;desc&quot;: &quot;狂神说Java desc&quot;</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div># text  </div><div># keyword</div><div><br/></div><div><br/></div><div>GET _analyze</div><div>{</div><div>  &quot;analyzer&quot;: &quot;keyword&quot;,</div><div>  &quot;text&quot;: &quot;狂神说Java name&quot;</div><div>}</div><div><br/></div><div><br/></div><div>GET _analyze</div><div>{</div><div>  &quot;analyzer&quot;: &quot;standard&quot;,</div><div>  &quot;text&quot;: &quot;狂神说Java name&quot;</div><div>}</div><div><br/></div><div><br/></div><div>#文档高亮查询， 后续所搜索模拟京东搜索效果一样，使用java-api</div><div>GET zzu/user/_search</div><div>{</div><div>&quot;query&quot;: {</div><div>  &quot;match&quot;: {</div><div>    &quot;name&quot;: &quot;花&quot;</div><div>  }</div><div>},</div><div>  &quot;highlight&quot;: {</div><div>    &quot;fields&quot;: {</div><div>      &quot;name&quot;:{</div><div>        </div><div>      }</div><div>    }</div><div>  }</div><div>}</div><div><br/></div><div><br/></div><div>GET zzu/user/_search</div><div>{</div><div>&quot;query&quot;: {</div><div>  &quot;match&quot;: {</div><div>    &quot;name&quot;: &quot;花&quot;</div><div>  }</div><div>},</div><div>  &quot;highlight&quot;: {</div><div>    &quot;pre_tags&quot;: &quot;&lt;p class='key' style='color=red' &gt;&quot;,</div><div>    &quot;post_tags&quot;: &quot;&lt;/p&gt;&quot;,</div><div>    &quot;fields&quot;: {</div><div>      &quot;name&quot;:{</div><div>        </div><div>      }</div><div>    }</div><div>  }</div><div>}</div></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div></div><div><br/></div></div><br/><div><table bgcolor="#D4DDE5" border="0" width="100%"><tr><td><h1>04 - ElasticSearch 常见 Java-api</h1><b>来源网址：</b> <a href="https://www.kuangstudy.com/bbs/1354069127022583809">https://www.kuangstudy.com/bbs/1354069127022583809</a><br/><b>作者：</b> syra-<br/></td></tr></table></div><div><div><div><div><span style="font-size: 18pt; font-weight: bold;"> 04 - ElasticSearch 常见 Java-api </span></div><div><font style="font-size: 16pt;"><br/></font></div><div><span style="font-size: 16pt; color: rgb(227, 0, 0); font-weight: bold;">一、springboot的es启动器</span></div><div><span style="font-size: 16pt;">注意：es的版本是7.x</span></div><div><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [52].png" type="image/png" data-filename="Image.png"/></span></div><div><span style="font-size: 16pt; color: rgb(227, 0, 0); font-weight: bold;">二、es的常用api</span></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">索引的操作</span></span></h4><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">1、索引的创建</span></span></h5></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 关于索引的操纵：</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      XXXXIndexRequest</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* RestHighLevelClient.indices().XX() 增删查</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      indices().create()</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      indices().exist()</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      indices().delete()</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><br/></div><div><br/></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 创建索引</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* @throws IOException</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">@Test</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">public void indexCreate() throws IOException {</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    CreateIndexRequest createIndexRequest = new CreateIndexRequest(ESCommon.ES_INDEX.getEs_index());</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    CreateIndexResponse createIndexResponse = client.indices().create(createIndexRequest, RequestOptions.DEFAULT);</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(createIndexResponse.index());</font></span></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">}</font></span></div></div><div><br/></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">2、索引的获取，并判断其是否存在</span></span></h5><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* index是否存在</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* @throws IOException</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">@Test</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">public void existIndex() throws IOException {</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    GetIndexRequest getIndexRequest = new GetIndexRequest(ESCommon.ES_INDEX.getEs_index());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    boolean exists = client.indices().exists(getIndexRequest, RequestOptions.DEFAULT);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(ESCommon.ES_INDEX.getEs_index() + &quot; &quot; + exists + &quot; 存在&quot;);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">}</font></span></div></div><div><br/></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">3、索引的删除</span></span></h5><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 删除索引</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">@Test</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">public void deleteIndex() throws IOException {</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(ESCommon.ES_INDEX.getEs_index());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    AcknowledgedResponse delete = client.indices().delete(deleteIndexRequest, RequestOptions.DEFAULT);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(delete.toString());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">}</font></span></div></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></h4><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">文档的操作</span></span></h4><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">1、文档的添加</span></span></h5><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 文档操作：</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      XXXRequest</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*  RestHighLevelClient.XX()</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      index()</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      exist()</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      get()</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      update()</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      delete()</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      bulk()</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*      search() //根据条件查询</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><br/></font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><br/></font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 增加文档</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">@Test</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">public void addDoc() throws IOException {</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    IndexRequest indexRequest = new IndexRequest(ESCommon.ES_INDEX.getEs_index());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    User user = new User(&quot;扈三娘&quot;, 18);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    //source必须四json类型</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    indexRequest.source(JsonUtil.getJson(user), XContentType.JSON);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><br/></font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><br/></font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    //设置id，时延</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    indexRequest.id(&quot;2&quot;);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    indexRequest.timeout(new TimeValue(3000, TimeUnit.SECONDS));</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><br/></font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><br/></font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    IndexResponse index = client.index(indexRequest, RequestOptions.DEFAULT);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(index.getIndex() + &quot; &quot; + index.status());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">}</font></span></div></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">2、文档信息的获取</span></span></h5><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 获取文档内容</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* @throws Exception</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">@Test</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">public void getDoc() throws Exception{</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    GetRequest request = new GetRequest(ESCommon.ES_INDEX.getEs_index(), &quot;1&quot;);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    GetResponse documentFields = client.get(request, RequestOptions.DEFAULT);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(documentFields.getSourceAsString());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(request);// 返回的全部内容和命令是一样的</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    Map&lt;String, Object&gt; sourceAsMap = documentFields.getSourceAsMap();</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    for (Map.Entry&lt;String, Object&gt; entry : sourceAsMap.entrySet()) {</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">        System.out.println(&quot;key:&quot;+entry.getKey()+&quot;  value:&quot;+entry.getValue());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    }</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">}</font></span></div></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">3、文档的获取，并判断其是否存在</span></span></h5><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 文档是否存在</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* @throws IOException</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">@Test</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">public void existDoc() throws IOException {</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    GetRequest request = new GetRequest(ESCommon.ES_INDEX.getEs_index(), &quot;1&quot;);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    boolean exists = client.exists(request, RequestOptions.DEFAULT);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(exists);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">}</font></span></div></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">4、文档的更新</span></span></h5><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 更新doc</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* @throws IOException</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">@Test</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">public void updateDoc() throws IOException{</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    UpdateRequest request = new UpdateRequest(ESCommon.ES_INDEX.getEs_index(), &quot;1&quot;);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    request.doc(JsonUtil.getJson(new User(&quot;扈三娘&quot;,15)) , XContentType.JSON);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    request.timeout(&quot;1s&quot;);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    UpdateResponse update = client.update(request, RequestOptions.DEFAULT);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(update.status() +&quot;  &quot;+ update.getGetResult());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">}</font></span></div></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">5、文档的删除</span></span></h5><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 删除doc</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* @throws Exception</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">@Test</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">public  void deleteDoc() throws Exception{</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    DeleteRequest request = new DeleteRequest(ESCommon.ES_INDEX.getEs_index(), &quot;1&quot;);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    DeleteResponse delete = client.delete(request, RequestOptions.DEFAULT);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(delete.status());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">}</font></span></div></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">6、批量添加数据</span></span></h5><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">/**</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">* 批量添加doc</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">*/</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">@Test</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">public void bulkDoc() throws IOException{</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    BulkRequest bulkRequest = new BulkRequest(ESCommon.ES_INDEX.getEs_index());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    List&lt;User&gt; users = new ArrayList&lt;User&gt;();</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    users.add(new User(&quot;test001&quot;,15));</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    users.add(new User(&quot;test002&quot;,16));</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    users.add(new User(&quot;test003&quot;,17));</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    users.add(new User(&quot;test004&quot;,18));</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    users.add(new User(&quot;test005&quot;,19));</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    bulkRequest.timeout(&quot;10s&quot;);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    for (int i = 0; i &lt; users.size(); i++) {</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">        //此处如果不设置id，es会生成随机的id</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">        IndexRequest source = new IndexRequest()</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">                .id(&quot;&quot;+i)</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">                .source(JsonUtil.getJson(users.get(i)), XContentType.JSON);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">        bulkRequest.add(source);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    }</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    BulkResponse bulk = client.bulk(bulkRequest, RequestOptions.DEFAULT);</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">    System.out.println(bulk.status());</font></span></div><div><span style="box-sizing: border-box; font-weight: bold; line-height: 1.4; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;">}</font></span></div></div><div><br/></div><div><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">7、高亮查询</span></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">/**</font></div><div><font style="font-size: 16pt;">* 查询</font></div><div><font style="font-size: 16pt;">* SearchRequest搜索请求</font></div><div><font style="font-size: 16pt;">* searchsourceBuilder条件构造</font></div><div><font style="font-size: 16pt;">* HighLightBuiLder构建高亮</font></div><div><font style="font-size: 16pt;">* TermQueryBuiLder精确查询</font></div><div><font style="font-size: 16pt;">* MatchALLQueryBuiLder</font></div><div><font style="font-size: 16pt;">* xxx QueryBuilder</font></div><div><font style="font-size: 16pt;">*/</font></div><div><font style="font-size: 16pt;">@Test</font></div><div><font style="font-size: 16pt;">public  void search() throws Exception{</font></div><div><font style="font-size: 16pt;">    //查询请求</font></div><div><font style="font-size: 16pt;">    SearchRequest searchRequest = new SearchRequest(ESCommon.ES_INDEX.getEs_index());</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //构建搜索</font></div><div><font style="font-size: 16pt;">    SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();</font></div><div><font style="font-size: 16pt;">    //分页</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.from(0);</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.size(20);</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.timeout(new TimeValue(60 , TimeUnit.SECONDS));</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //高亮</font></div><div><font style="font-size: 16pt;">    HighlightBuilder highlighterbuilder = new HighlightBuilder();</font></div><div><font style="font-size: 16pt;">    highlighterbuilder.preTags(&quot;&lt;span style='color:red'&gt;&quot;);</font></div><div><font style="font-size: 16pt;">    highlighterbuilder.postTags(&quot;&lt;/span&gt;&quot;);</font></div><div><font style="font-size: 16pt;">    highlighterbuilder.field(&quot;name&quot;);</font></div><div><font style="font-size: 16pt;">    //highlighterbuilder.requireFieldMatch(false);</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.highlighter(highlighterbuilder);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //查询条件</font></div><div><font style="font-size: 16pt;">      //TermQueryBuilder 精确查询 等同于 term</font></div><div><font style="font-size: 16pt;">      //MatchAllQueryBuilder 匹配所有</font></div><div><font style="font-size: 16pt;">    TermQueryBuilder termQueryBuilder = QueryBuilders.termQuery(&quot;name&quot;, &quot;java&quot;);</font></div><div><font style="font-size: 16pt;">    MatchAllQueryBuilder matchAllQueryBuilder = QueryBuilders.matchAllQuery();</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.query(termQueryBuilder);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //请求封装搜索条件</font></div><div><font style="font-size: 16pt;">    searchRequest.source(searchSourceBuilder);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //请求</font></div><div><font style="font-size: 16pt;">    SearchResponse search = client.search(searchRequest, RequestOptions.DEFAULT);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //打印几个对象看一下啊</font></div><div><font style="font-size: 16pt;">    System.out.println(searchRequest);</font></div><div><font style="font-size: 16pt;">    System.out.println(searchSourceBuilder);</font></div><div><font style="font-size: 16pt;">    System.out.println(highlighterbuilder);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //高亮结果集合</font></div><div><font style="font-size: 16pt;">    ArrayList&lt;Map&lt;String , Object&gt;&gt; users = new ArrayList&lt;&gt;();</font></div><div><font style="font-size: 16pt;">    //高亮结果处理</font></div><div><font style="font-size: 16pt;">    for (SearchHit hit : search.getHits().getHits()) {</font></div><div><font style="font-size: 16pt;">        System.out.println(hit+&quot;=========================&quot;);</font></div><div><font style="font-size: 16pt;">        Map&lt;String, HighlightField&gt; highlightFields = hit.getHighlightFields();</font></div><div><font style="font-size: 16pt;">        System.out.println(highlightFields+&quot;-----------------------------------------&quot;);</font></div><div><font style="font-size: 16pt;">        HighlightField name = highlightFields.get(&quot;name&quot;);</font></div><div><font style="font-size: 16pt;">        System.out.println(name);</font></div><div><font style="font-size: 16pt;">        //原来的结果</font></div><div><font style="font-size: 16pt;">        Map&lt;String, Object&gt; sourceAsMap = hit.getSourceAsMap();</font></div><div><font style="font-size: 16pt;">        System.out.println(sourceAsMap+&quot;++++++++++++++++++++++++++++++++++++++++++++&quot;);</font></div><div><font style="font-size: 16pt;">        //解析高亮的字段，并将原来的字段替换成高亮字段即可</font></div><div><font style="font-size: 16pt;">        if(name != null){</font></div><div><font style="font-size: 16pt;">            Text[] fragments = name.fragments();</font></div><div><font style="font-size: 16pt;">            String new_name = &quot;&quot;;</font></div><div><font style="font-size: 16pt;">            for (Text fragment : fragments) {</font></div><div><font style="font-size: 16pt;">                new_name += fragment;</font></div><div><font style="font-size: 16pt;">            }</font></div><div><font style="font-size: 16pt;">            System.out.println(new_name);</font></div><div><font style="font-size: 16pt;">            //替换掉原来字段</font></div><div><font style="font-size: 16pt;">            sourceAsMap.put(&quot;name&quot;,new_name);</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">            users.add(sourceAsMap);</font></div><div><font style="font-size: 16pt;">        System.out.println(users.toString());</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //结果处理</font></div><div><font style="font-size: 16pt;">    for (SearchHit hit : search.getHits().getHits()) {</font></div><div><font style="font-size: 16pt;">        Map&lt;String, Object&gt; sourceAsMap = hit.getSourceAsMap();</font></div><div><font style="font-size: 16pt;">        Iterator&lt;Map.Entry&lt;String, Object&gt;&gt; iterator = sourceAsMap.entrySet().iterator();</font></div><div><font style="font-size: 16pt;">        while(iterator.hasNext()){</font></div><div><font style="font-size: 16pt;">            Map.Entry&lt;String, Object&gt; next = iterator.next();</font></div><div><font style="font-size: 16pt;">            System.out.println(next.getKey() + &quot;  :  &quot;+ next.getValue());</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">}</font></div></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div></div><div><br/></div></div><br/><div><table bgcolor="#D4DDE5" border="0" width="100%"><tr><td><h1>05 - ElasticSearch 京东实战小demo.</h1><b>来源网址：</b> <a href="https://www.kuangstudy.com/bbs/1354069127022583809">https://www.kuangstudy.com/bbs/1354069127022583809</a><br/><b>作者：</b> syra-<br/></td></tr></table></div><div><div><div><div><span style="font-size: 16pt; font-weight: bold;"> 05 - ElasticSearch 京东实战小demo.</span></div><h1 style="box-sizing: border-box; padding: 0px 0px 0.3em; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.2;">安装包及前端素材</span></h1><div><span style="font-size: 16pt;">链接：</span><a href="https://pan.baidu.com/s/1M5uWdYsCZyzIAOcgcRkA_A" style="box-sizing: border-box; background: transparent; font-size: 16pt; color: rgb(65, 131, 196);" title="爱搜资源助手：资源正常">https://pan.baidu.com/s/1M5uWdYsCZyzIAOcgcRkA_A</a></div><div><span style="font-size: 16pt;">提取码：qk8p</span></div><div style="margin-top: 1em; margin-bottom: 1em;"><span style="font-size: 16pt;-en-paragraph:true;">复制这段内容后打开百度网盘手机App，操作更方便哦</span></div><div style="margin-top: 1em; margin-bottom: 1em;"><span style="font-size: 16pt;">附git地址，实战demo和笔记：</span><a href="https://gitee.com/yujie.louis/elastic-search" style="font-size: 16pt;">https://gitee.com/yujie.louis/elastic-search</a></div><hr/><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">1、创建工程</span></span></h3><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">略</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">目录结构</span></span></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">2、导入依赖</span></span></h3><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">注意依赖版本和安装的版本一致</span></span></div></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">&lt;properties&gt;</font></div><div><font style="font-size: 16pt;">    &lt;java.version&gt;1.8&lt;/java.version&gt;</font></div><div><font style="font-size: 16pt;">    &lt;!-- 统一版本 --&gt;</font></div><div><font style="font-size: 16pt;">    &lt;elasticsearch.version&gt;7.6.1&lt;/elasticsearch.version&gt;</font></div><div><font style="font-size: 16pt;">&lt;/properties&gt;</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">导入elasticsearch</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">&lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">    &lt;artifactId&gt;spring-boot-starter-data-elasticsearch&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">&lt;/dependency&gt;</font></div></div></div><h1 style="box-sizing: border-box; padding: 0px 0px 0.3em; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.2;">ElasticSearch实战</span></span></h1><h2 style="box-sizing: border-box; padding: 8px 10px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: rgb(204, 229, 255); border-radius: 3px; position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: rgb(204, 229, 255); border-radius: 3px; position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="background-color: rgb(204, 229, 255);"><span style="background-color: rgb(204, 229, 255);"><span style="background-color: rgb(204, 229, 255); font-size: 16pt; color: rgb(84, 88, 87); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.425;">防京东商城搜索（高亮）</span></span></span></span></h2><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">1、工程创建（springboot）</span></span></h3><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">创建过程略</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">目录结构</span></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><img src="./ElasticSearch/Image [53].png" type="image/png" data-filename="Image.png" width="1038"/></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">2、基本编码</span></span></h3><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">①导入依赖</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</font></div><div><font style="font-size: 16pt;">&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;</font></div><div><font style="font-size: 16pt;">         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</font></div><div><font style="font-size: 16pt;">         xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;</font></div><div><font style="font-size: 16pt;">    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;</font></div><div><font style="font-size: 16pt;">    &lt;parent&gt;</font></div><div><font style="font-size: 16pt;">        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">        &lt;version&gt;2.3.4.RELEASE&lt;/version&gt;</font></div><div><font style="font-size: 16pt;">    &lt;/parent&gt;</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    &lt;groupId&gt;cn.edu.zzu&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">    &lt;artifactId&gt;TestElasticsearch01&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    &lt;properties&gt;</font></div><div><font style="font-size: 16pt;">        &lt;maven.compiler.source&gt;8&lt;/maven.compiler.source&gt;</font></div><div><font style="font-size: 16pt;">        &lt;maven.compiler.target&gt;8&lt;/maven.compiler.target&gt;</font></div><div><font style="font-size: 16pt;">        &lt;elasticsearch.version&gt;7.6.1&lt;/elasticsearch.version&gt;</font></div><div><font style="font-size: 16pt;">    &lt;/properties&gt;</font></div><div><font style="font-size: 16pt;">    &lt;dependencies&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!--thymleaf--&gt;</font></div><div><font style="font-size: 16pt;">        &lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/dependency&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!--jsoup--&gt;</font></div><div><font style="font-size: 16pt;">        &lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">            &lt;groupId&gt;org.jsoup&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;artifactId&gt;jsoup&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;version&gt;1.10.3&lt;/version&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/dependency&gt;</font></div><div><font style="font-size: 16pt;">        &lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/dependency&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!--es--&gt;</font></div><div><font style="font-size: 16pt;">        &lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;artifactId&gt;spring-boot-starter-data-elasticsearch&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/dependency&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!--热部署--&gt;</font></div><div><font style="font-size: 16pt;">        &lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/dependency&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!--process--&gt;</font></div><div><font style="font-size: 16pt;">        &lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;artifactId&gt;spring-boot-configuration-processor&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/dependency&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!--test--&gt;</font></div><div><font style="font-size: 16pt;">        &lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/dependency&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!--junti--&gt;</font></div><div><font style="font-size: 16pt;">        &lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">            &lt;groupId&gt;junit&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;artifactId&gt;junit&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;scope&gt;test&lt;/scope&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/dependency&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!--lombok--&gt;</font></div><div><font style="font-size: 16pt;">        &lt;dependency&gt;</font></div><div><font style="font-size: 16pt;">            &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;</font></div><div><font style="font-size: 16pt;">            &lt;artifactId&gt;lombok&lt;/artifactId&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/dependency&gt;</font></div><div><font style="font-size: 16pt;">    &lt;/dependencies&gt;</font></div><div><font style="font-size: 16pt;">    &lt;repositories&gt;</font></div><div><font style="font-size: 16pt;">        &lt;repository&gt;</font></div><div><font style="font-size: 16pt;">            &lt;id&gt;es-snapshots&lt;/id&gt;</font></div><div><font style="font-size: 16pt;">            &lt;name&gt;elasticsearch snapshot repo&lt;/name&gt;</font></div><div><font style="font-size: 16pt;">            &lt;url&gt;https://snapshots.elastic.co/maven/&lt;/url&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/repository&gt;</font></div><div><font style="font-size: 16pt;">    &lt;/repositories&gt;</font></div><div><font style="font-size: 16pt;">&lt;/project&gt;</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">②导入前端素材</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">略</span></span></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">③编写</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">application.preperties</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">配置文件</span></font></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;"># 更改端口，防止冲突</font></div><div><font style="font-size: 16pt;">server.port=8081</font></div><div><font style="font-size: 16pt;"># 关闭thymeleaf缓存</font></div><div><font style="font-size: 16pt;">spring.thymeleaf.cache=false</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">④测试controller和view</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;"><span style="background-color: initial; color: rgb(0, 102, 102); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">@Controller</span></font></div><div><font style="font-size: 16pt;"><span style="background-color: initial; color: rgb(0, 102, 102); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">public class IndexController {</span></font></div><div><font style="font-size: 16pt;"><span style="background-color: initial; color: rgb(0, 102, 102); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">    @GetMapping({&quot;/&quot;,&quot;index&quot;})</span></font></div><div><font style="font-size: 16pt;">    public String index(){</font></div><div><font style="font-size: 16pt;">        return &quot;index&quot;;</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">}</font></div></div><div><font style="font-size: 16pt;"><br/></font></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">访问 localhost:9999</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;"><img src="./ElasticSearch/Image [54].png" type="image/png" data-filename="Image.png" style="box-sizing: border-box; padding: 15px; margin: 5px 0px; list-style: none; vertical-align: middle; border: 0px; max-width: 100%; height: auto; background: rgb(255, 255, 255); box-shadow: rgb(219, 219, 219) 0px 0px 12px inset; cursor: zoom-in;"/></span></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">到这里可以先去编写爬虫，编写之后，回到这里</span></span></div></blockquote><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">⑤编写Config</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">@Configuration</font></div><div><font style="font-size: 16pt;">public class ElasticSearchConfig {</font></div><div><font style="font-size: 16pt;">    @Bean</font></div><div><font style="font-size: 16pt;">    public RestHighLevelClient restHighLevelClient(){</font></div><div><font style="font-size: 16pt;">        RestHighLevelClient client = new RestHighLevelClient(</font></div><div><font style="font-size: 16pt;">        RestClient.builder(</font></div><div><font style="font-size: 16pt;">            new HttpHost(&quot;127.0.0.1&quot;,9200,&quot;http&quot;)</font></div><div><font style="font-size: 16pt;">        )</font></div><div><font style="font-size: 16pt;">    );</font></div><div><font style="font-size: 16pt;">    return client;</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">}</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">⑥编写service</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">ContentService</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">@Autowired</font></div><div><font style="font-size: 16pt;">RestHighLevelClient restHighLevelClient;</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">/**</font></div><div><font style="font-size: 16pt;">* 根据关键词进行解析数据添加到ES中供之后的检索</font></div><div><font style="font-size: 16pt;">* @param keyword</font></div><div><font style="font-size: 16pt;">* @return</font></div><div><font style="font-size: 16pt;">* @throws IOException</font></div><div><font style="font-size: 16pt;">*/</font></div><div><font style="font-size: 16pt;">@Override</font></div><div><font style="font-size: 16pt;">public boolean parseAndInsertES(String keyword) throws IOException {</font></div><div><font style="font-size: 16pt;">    List&lt;Content&gt; contents = new HtmlParseUtils().parseKey(keyword);</font></div><div><font style="font-size: 16pt;">    //批量添加数据</font></div><div><font style="font-size: 16pt;">    BulkRequest bulkRequest = new BulkRequest(ESCommon.ES_INDEX.getEs_index());</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //超时配置</font></div><div><font style="font-size: 16pt;">    bulkRequest.timeout(new TimeValue(60, TimeUnit.SECONDS));</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //结果封装到请求中</font></div><div><font style="font-size: 16pt;">    for (int i = 0; i &lt; contents.size(); i++) {</font></div><div><font style="font-size: 16pt;">        bulkRequest.add(new IndexRequest().source(</font></div><div><font style="font-size: 16pt;">                JsonUtil.getJson(contents.get(i)), XContentType.JSON)</font></div><div><font style="font-size: 16pt;">        );</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    BulkResponse bulk = restHighLevelClient.bulk(bulkRequest, RequestOptions.DEFAULT);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    if (bulk.status() == RestStatus.OK) {</font></div><div><font style="font-size: 16pt;">        return true;</font></div><div><font style="font-size: 16pt;">    } else {</font></div><div><font style="font-size: 16pt;">        return false;</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">}</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">⑦编写controller</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><span style="font-size: 16pt;">/**</span></div><div><font style="font-size: 16pt;">* keyword先插入到es中</font></div><div><font style="font-size: 16pt;">*</font></div><div><font style="font-size: 16pt;">* @param keyword</font></div><div><font style="font-size: 16pt;">* @return</font></div><div><font style="font-size: 16pt;">* @throws IOException</font></div><div><font style="font-size: 16pt;">*/</font></div><div><font style="font-size: 16pt;">@GetMapping(&quot;/insertES/{keyword}&quot;)</font></div><div><font style="font-size: 16pt;">@ResponseBody</font></div><div><font style="font-size: 16pt;">public boolean insertEsKeyword(@PathVariable(&quot;keyword&quot;) String keyword) throws IOException {</font></div><div><font style="font-size: 16pt;">    boolean b = iContentService.parseAndInsertES(keyword);</font></div><div><font style="font-size: 16pt;">    return true;</font></div><div><font style="font-size: 16pt;">}</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">/**</font></div><div><font style="font-size: 16pt;">* 查询结果返回</font></div><div><font style="font-size: 16pt;">* @param keyword</font></div><div><font style="font-size: 16pt;">* @return</font></div><div><font style="font-size: 16pt;">*/</font></div><div><font style="font-size: 16pt;">@GetMapping(&quot;/search/{keyword}/{from}/{size}&quot;)</font></div><div><font style="font-size: 16pt;">@ResponseBody</font></div><div><font style="font-size: 16pt;">public List&lt;Map&lt;String ,Object&gt;&gt; searchKeyword(@PathVariable(&quot;keyword&quot;) String keyword,</font></div><div><font style="font-size: 16pt;">                            @PathVariable(&quot;from&quot;) int from ,</font></div><div><font style="font-size: 16pt;">                            @PathVariable(&quot;size&quot;) int size) throws IOException{</font></div><div><font style="font-size: 16pt;">    List&lt;Map&lt;String, Object&gt;&gt; list = iElasticSearchService.searchKeyword(keyword , from , size);</font></div><div><font style="font-size: 16pt;">    return list;</font></div><div><font style="font-size: 16pt;">}</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">⑧测试结果</span></span></h4><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">1、解析数据放入 es 索引中</span></span></h5><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [55].png" type="image/png" data-filename="Image.png"/></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><img src="./ElasticSearch/Image [56].png" type="image/png" data-filename="Image.png" width="1267"/><br/></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">2、根据keyword分页查询结果</span></span></h5><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [57].png" type="image/png" data-filename="Image.png"/></span><br/></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">3、爬虫（jsoup）</span></span></h3><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">数据获取：数据库、消息队列、爬虫、…</span></span></div></blockquote><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">①搜索京东搜索页面，并分析页面</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(0, 0, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">http</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">:</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(136, 0, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">//<a href="http://search.jd.com/search?keyword=java" style="background-color: initial; font-size: 16pt; font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">search.jd.com/search?keyword=java</a></span></font></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">页面如下</span></span></h5><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [58].png" type="image/png" data-filename="Image.png" width="1110"/></span></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">审查页面元素</span></span></h5><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">页面列表id：J_goodsList</span></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [59].png" type="image/png" data-filename="Image.png"/></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">目标元素：img、price、name</span></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [60].png" type="image/png" data-filename="Image.png"/></span></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">②爬取数据（获取请求返回的页面信息，筛选出可用的）</span></span></h4><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">创建HtmlParseUtil，并简单编写</span></span></h5><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><br/></font></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">public class HtmlParseUtil {</font></div><div><font style="font-size: 16pt;">public static void main(String[] args) throws IOException {</font></div><div><font style="font-size: 16pt;">        /// 使用前需要联网</font></div><div><font style="font-size: 16pt;">        // 请求url</font></div><div><font style="font-size: 16pt;">        String url = &quot;http://search.jd.com/search?keyword=java&quot;;</font></div><div><font style="font-size: 16pt;">        // 1.解析网页(jsoup 解析返回的对象是浏览器Document对象)</font></div><div><font style="font-size: 16pt;">        Document document = Jsoup.parse(new URL(url), 30000);</font></div><div><font style="font-size: 16pt;">        // 使用document可以使用在js对document的所有操作</font></div><div><font style="font-size: 16pt;">        // 2.获取元素（通过id）</font></div><div><font style="font-size: 16pt;">        Element j_goodsList = document.getElementById(&quot;J_goodsList&quot;);</font></div><div><font style="font-size: 16pt;">        // 3.获取J_goodsList ul 每一个 li</font></div><div><font style="font-size: 16pt;">        Elements lis = j_goodsList.getElementsByTag(&quot;li&quot;);</font></div><div><font style="font-size: 16pt;">        // 4.获取li下的 img、price、name</font></div><div><font style="font-size: 16pt;">       for (Element li : lis) {</font></div><div><font style="font-size: 16pt;">        String img = li.getElementsByTag(&quot;img&quot;).eq(0).attr(&quot;src&quot;);// 获取li下 第一张图片</font></div><div><font style="font-size: 16pt;">        String name = li.getElementsByClass(&quot;p-name&quot;).eq(0).text();</font></div><div><font style="font-size: 16pt;">        String price = li.getElementsByClass(&quot;p-price&quot;).eq(0).text();</font></div><div><font style="font-size: 16pt;">        System.out.println(&quot;=======================&quot;);</font></div><div><font style="font-size: 16pt;">        System.out.println(&quot;img : &quot; + img);</font></div><div><font style="font-size: 16pt;">        System.out.println(&quot;name : &quot; + name);</font></div><div><font style="font-size: 16pt;">        System.out.println(&quot;price : &quot; + price);</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">}</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">运行结果</span></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [61].png" type="image/png" data-filename="Image.png"/></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">原因是啥？</span></span></div><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">一般图片特别多的网站，所有的图片都是通过延迟加载的</span></span></div></blockquote><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">// 打印标签内容</font></div><div><font style="font-size: 16pt;">Elements lis = j_goodsList.getElementsByTag(&quot;li&quot;);</font></div><div><font style="font-size: 16pt;">System.out.println(lis);</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">打印所有li标签，发现img标签中并没有属性src的设置，只是data-lazy-ing设置图片加载的地址</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;"><img src="./ElasticSearch/Image [62].png" type="image/png" data-filename="Image.png" style="box-sizing: border-box; padding: 15px; margin: 5px 0px; list-style: none; vertical-align: middle; border: 0px; max-width: 100%; height: auto; background: rgb(255, 255, 255); box-shadow: rgb(219, 219, 219) 0px 0px 12px inset; cursor: zoom-in;"/></span></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">创建HtmlParseUtil、改写</span></span></h5><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;">更改图片获取属性为</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt;"> </span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: break-word; background: rgb(246, 246, 246); border-radius: 3px; border: 1px solid rgb(238, 238, 238); font-size: 16pt; color: rgb(232, 62, 140); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">data-lazy-img</span></font></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;">与实体类结合，实体类如下</font></span></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">@Data</font></div><div><font style="font-size: 16pt;">@AllArgsConstructor</font></div><div><font style="font-size: 16pt;">@NoArgsConstructor</font></div><div><font style="font-size: 16pt;">public class Content implements Serializable {</font></div><div><font style="font-size: 16pt;">    private String name;</font></div><div><font style="font-size: 16pt;">    private String img;</font></div><div><font style="font-size: 16pt;">    private String price;</font></div><div><font style="font-size: 16pt;">    private String shopnum;</font></div><div><font style="font-size: 16pt;">}</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">封装为方法</span></span></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">  private static final String URL_PATH = &quot;https://search.jd.com/Search?keyword=&quot;;</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    public static void main(String[] args) {</font></div><div><font style="font-size: 16pt;">        try {</font></div><div><font style="font-size: 16pt;">            new HtmlParseUtils().parseKey(&quot;java&quot;).forEach(System.out::println);</font></div><div><font style="font-size: 16pt;">        } catch (IOException e) {</font></div><div><font style="font-size: 16pt;">            e.printStackTrace();</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    public List&lt;Content&gt; parseKey(String keyword) throws IOException {</font></div><div><font style="font-size: 16pt;">        Document document = Jsoup.parse(new URL(URL_PATH + keyword), 3000);</font></div><div><font style="font-size: 16pt;">        Element j_goodsList = document.getElementById(&quot;J_goodsList&quot;);</font></div><div><font style="font-size: 16pt;">        Elements li = j_goodsList.getElementsByTag(&quot;li&quot;);</font></div><div><font style="font-size: 16pt;">        ArrayList&lt;Content&gt; contents = new ArrayList&lt;&gt;();</font></div><div><font style="font-size: 16pt;">        for (Element element : li) {</font></div><div><font style="font-size: 16pt;">            String name = element.getElementsByClass(&quot;p-name&quot;).eq(0).text();</font></div><div><font style="font-size: 16pt;">            String img = element.getElementsByTag(&quot;img&quot;).eq(0).attr(&quot;data-lazy-img&quot;);</font></div><div><font style="font-size: 16pt;">            String price = element.getElementsByClass(&quot;p-price&quot;).eq(0).text();</font></div><div><font style="font-size: 16pt;">            String shopnum = element.getElementsByClass(&quot;p-shopnum&quot;).eq(0).text();</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">            //Elements links = element.select(&quot;a[href]&quot;); // 具有 href 属性的链接</font></div><div><font style="font-size: 16pt;">            //Elements pngs = element.select(&quot;img[src$=.png]&quot;);// 所有引用 png 图片的元素</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">/*            System.out.println(img);</font></div><div><font style="font-size: 16pt;">            System.out.println(price);</font></div><div><font style="font-size: 16pt;">            System.out.println(name);</font></div><div><font style="font-size: 16pt;">            System.out.println(shopnum);</font></div><div><font style="font-size: 16pt;">            System.out.println(&quot;========================&quot;);*/</font></div><div><font style="font-size: 16pt;">            contents.add(new Content(name, img, price, shopnum));</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">        return contents;</font></div><div><font style="font-size: 16pt;">    }</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></div><div style="box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; border-radius: 20px;"><span style="font-size: 16pt; color: rgb(24, 24, 24); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold;">结果展示</span></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><img src="./ElasticSearch/Image [63].png" type="image/png" data-filename="Image.png" width="1057"/></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">4、搜索高亮</span></span></h3><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">在3、的基础上添加内容</span></span></div></blockquote><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">①ContentService</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">/**</font></div><div><font style="font-size: 16pt;">* 高亮</font></div><div><font style="font-size: 16pt;">*</font></div><div><font style="font-size: 16pt;">* @param keyword</font></div><div><font style="font-size: 16pt;">* @param from</font></div><div><font style="font-size: 16pt;">* @param size</font></div><div><font style="font-size: 16pt;">* @return</font></div><div><font style="font-size: 16pt;">* @throws IOException</font></div><div><font style="font-size: 16pt;">*/</font></div><div><font style="font-size: 16pt;">@Override</font></div><div><font style="font-size: 16pt;">public List&lt;Map&lt;String, Object&gt;&gt; searchHighLightKeyword(String keyword, int from, int size) throws IOException {</font></div><div><font style="font-size: 16pt;">    SearchRequest searchRequest = new SearchRequest(ESCommon.ES_INDEX.getEs_index());</font></div><div><font style="font-size: 16pt;">    SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.timeout(new TimeValue(60, TimeUnit.SECONDS));</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.from(from);</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.size(size);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //高亮</font></div><div><font style="font-size: 16pt;">    HighlightBuilder highlightBuilder = new HighlightBuilder();</font></div><div><font style="font-size: 16pt;">    highlightBuilder.preTags(&quot;&lt;span style='color:red'&gt;&quot;);</font></div><div><font style="font-size: 16pt;">    highlightBuilder.postTags(&quot;&lt;/span&gt;&quot;);</font></div><div><font style="font-size: 16pt;">    highlightBuilder.field(&quot;name&quot;);</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.highlighter(highlightBuilder);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //查询条件</font></div><div><font style="font-size: 16pt;">    TermQueryBuilder name = QueryBuilders.termQuery(&quot;name&quot;, keyword);</font></div><div><font style="font-size: 16pt;">    searchSourceBuilder.query(name);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //封装条件</font></div><div><font style="font-size: 16pt;">    searchRequest.source(searchSourceBuilder);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //请求</font></div><div><font style="font-size: 16pt;">    SearchResponse search = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);</font></div><div><font style="font-size: 16pt;"><br/></font></div><div><font style="font-size: 16pt;">    //结果处理</font></div><div><font style="font-size: 16pt;">    ArrayList&lt;Map&lt;String, Object&gt;&gt; maps = new ArrayList&lt;&gt;();</font></div><div><font style="font-size: 16pt;">    if (search.status() == RestStatus.OK) {</font></div><div><font style="font-size: 16pt;">        for (SearchHit hit : search.getHits().getHits()) {</font></div><div><font style="font-size: 16pt;">            Map&lt;String, HighlightField&gt; highlightFields = hit.getHighlightFields();</font></div><div><font style="font-size: 16pt;">            HighlightField name1 = highlightFields.get(&quot;name&quot;);</font></div><div><font style="font-size: 16pt;">            System.out.println(name1+&quot;==============&quot;);</font></div><div><font style="font-size: 16pt;">            String new_name = &quot;&quot;;</font></div><div><font style="font-size: 16pt;">            Map&lt;String, Object&gt; sourceAsMap = hit.getSourceAsMap();</font></div><div><font style="font-size: 16pt;">            if(name1 !=null){</font></div><div><font style="font-size: 16pt;">                Text[] fragments = name1.fragments();</font></div><div><font style="font-size: 16pt;">                for (Text fragment : fragments) {</font></div><div><font style="font-size: 16pt;">                    new_name += fragment;</font></div><div><font style="font-size: 16pt;">                }</font></div><div><font style="font-size: 16pt;">            }</font></div><div><font style="font-size: 16pt;">            sourceAsMap.put(&quot;name&quot;, new_name);</font></div><div><font style="font-size: 16pt;">            maps.add(sourceAsMap);</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">        return maps;</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">    throw new RuntimeException(&quot;高亮搜索失败！&quot;);// 异常尽量统一处理；GlobalException</font></div><div><font style="font-size: 16pt;">}</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><br/></font></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">②ContentController</span></span></h4><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><br/></font></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">/**</font></div><div><font style="font-size: 16pt;">* 高亮查询</font></div><div><font style="font-size: 16pt;">* @param keyword</font></div><div><font style="font-size: 16pt;">* @return</font></div><div><font style="font-size: 16pt;">* @throws IOException</font></div><div><font style="font-size: 16pt;">*/</font></div><div><font style="font-size: 16pt;">@GetMapping(&quot;/searchHighLight/{keyword}/{from}/{size}&quot;)</font></div><div><font style="font-size: 16pt;">@ResponseBody</font></div><div><font style="font-size: 16pt;">public List&lt;Map&lt;String, Object&gt;&gt; searchHighLightKeyword(@PathVariable(&quot;keyword&quot;) String keyword,</font></div><div><font style="font-size: 16pt;">                                                        @PathVariable(&quot;from&quot;) int from ,</font></div><div><font style="font-size: 16pt;">                                                        @PathVariable(&quot;size&quot;) int size) throws IOException{</font></div><div><font style="font-size: 16pt;">    List&lt;Map&lt;String, Object&gt;&gt; list = iElasticSearchService.searchHighLightKeyword(keyword , from , size);</font></div><div><font style="font-size: 16pt;">    return list;</font></div><div><font style="font-size: 16pt;">}</font></div></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">③结果展示</span></span></h4><div style="text-align: center;"><span style="font-size: 16pt;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;; font-weight: bold;"><img src="./ElasticSearch/Image [64].png" type="image/png" data-filename="Image.png" width="1051"/></span></span></div><h3 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.43;">5、前后端分离（简单使用Vue）</span></span></h3><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">删除Controller 方法上的</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;"> </span><a href="https://github.com/ResponseBody" style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: transparent; font-size: 16pt; color: rgb(65, 131, 196); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;" title="@ResponseBody">@ResponseBody</a><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">注解  // 此处都行 @RestController  或者 @ResponseBody。不走视图解析器</span></font></div></blockquote><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><img src="./ElasticSearch/Image [65].png" type="image/png" data-filename="Image.png"/></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">①下载并引入Vue.min.js和axios.js</span></span></h4><blockquote style="box-sizing: border-box; padding: 10px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-left: 4px solid rgb(139, 195, 74); background: rgb(248, 248, 248); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal;">如果安装了nodejs，可以按如下步骤，没有可以到后面素材处下载  ；可以使用cdn</span></span></div></blockquote><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [66].png" type="image/png" data-filename="Image.png" width="1154"/></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">npm install vue</font></div><div><font style="font-size: 16pt;">npm install axios</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><font style="font-size: 16pt;"><br/></font></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [67].png" type="image/png" data-filename="Image.png"/></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [68].png" type="image/png" data-filename="Image.png"/></span></div><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [69].png" type="image/png" data-filename="Image.png"/></span></div><h4 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">②修改静态页面</span></span></h4><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">引入js</span></span></h5><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(0, 0, 136); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">&lt;script</span> <span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 0, 102); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">th:src</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">=</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(0, 136, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">&quot;@{/js/vue.min.js}&quot;</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-wrap: normal; word-break: normal; background: none; border-radius: 3px; border: none; font-size: 16pt; color: rgb(0, 0, 136); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">&gt;&lt;/script&gt;</span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: rgb(238, 238, 238);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: none; overflow-wrap: normal; word-break: normal; border-radius: 3px; border: none; font-size: 16pt; color: rgb(0, 0, 136); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">&lt;script</span> <span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: none; overflow-wrap: normal; word-break: normal; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 0, 102); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">th:src</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: none; overflow-wrap: normal; word-break: normal; border-radius: 3px; border: none; font-size: 16pt; color: rgb(102, 102, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">=</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: none; overflow-wrap: normal; word-break: normal; border-radius: 3px; border: none; font-size: 16pt; color: rgb(0, 136, 0); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">&quot;@{/js/axios.min.js}&quot;</span><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: none; overflow-wrap: normal; word-break: normal; border-radius: 3px; border: none; font-size: 16pt; color: rgb(0, 0, 136); font-family: &quot;YaHei Consolas Hybrid&quot;, Consolas, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Helvetica, monospace, monospace;">&gt;&lt;/script&gt;</span></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">修改后的index.html</span></span></h5><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">&lt;!DOCTYPE html&gt;</font></div><div><font style="font-size: 16pt;">&lt;html xmlns:th=&quot;http://www.thymeleaf.org&quot;&gt;</font></div><div><font style="font-size: 16pt;">&lt;head&gt;</font></div><div><font style="font-size: 16pt;">    &lt;meta charset=&quot;utf-8&quot;/&gt;</font></div><div><font style="font-size: 16pt;">    &lt;title&gt;狂神说Java-ES仿京东实战&lt;/title&gt;</font></div><div><font style="font-size: 16pt;">    &lt;link rel=&quot;stylesheet&quot; th:href=&quot;@{/css/style.css}&quot;/&gt;</font></div><div><font style="font-size: 16pt;">    &lt;script th:src=&quot;@{/js/jquery.min.js}&quot;&gt;&lt;/script&gt;</font></div><div><font style="font-size: 16pt;">&lt;/head&gt;</font></div><div><font style="font-size: 16pt;">&lt;body class=&quot;pg&quot;&gt;</font></div><div><font style="font-size: 16pt;">&lt;div class=&quot;page&quot;&gt;</font></div><div><font style="font-size: 16pt;">    &lt;div id=&quot;app&quot; class=&quot; mallist tmall- page-not-market &quot;&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!-- 头部搜索 --&gt;</font></div><div><font style="font-size: 16pt;">        &lt;div id=&quot;header&quot; class=&quot; header-list-app&quot;&gt;</font></div><div><font style="font-size: 16pt;">            &lt;div class=&quot;headerLayout&quot;&gt;</font></div><div><font style="font-size: 16pt;">                &lt;div class=&quot;headerCon &quot;&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;!-- Logo--&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;h1 id=&quot;mallLogo&quot;&gt;</font></div><div><font style="font-size: 16pt;">                        &lt;img th:src=&quot;@{/images/jdlogo.png}&quot; alt=&quot;&quot;&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;/h1&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;div class=&quot;header-extra&quot;&gt;</font></div><div><font style="font-size: 16pt;">                        &lt;!--搜索--&gt;</font></div><div><font style="font-size: 16pt;">                        &lt;div id=&quot;mallSearch&quot; class=&quot;mall-search&quot;&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;form name=&quot;searchTop&quot; class=&quot;mallSearch-form clearfix&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;fieldset&gt;</font></div><div><font style="font-size: 16pt;">                                    &lt;legend&gt;天猫搜索&lt;/legend&gt;</font></div><div><font style="font-size: 16pt;">                                    &lt;div class=&quot;mallSearch-input clearfix&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                        &lt;div class=&quot;s-combobox&quot; id=&quot;s-combobox-685&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                            &lt;div class=&quot;s-combobox-input-wrap&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                                &lt;input v-model=&quot;keyword&quot; type=&quot;text&quot; autocomplete=&quot;off&quot; id=&quot;mq&quot;</font></div><div><font style="font-size: 16pt;">                                                       class=&quot;s-combobox-input&quot; aria-haspopup=&quot;true&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                            &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                                        &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                                        &lt;button type=&quot;submit&quot; @click.prevent=&quot;searchKey&quot; id=&quot;searchbtn&quot;&gt;搜索&lt;/button&gt;</font></div><div><font style="font-size: 16pt;">                                    &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;/fieldset&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;/form&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;ul class=&quot;relKeyTop&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;li&gt;&lt;a&gt;狂神说Java&lt;/a&gt;&lt;/li&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;li&gt;&lt;a&gt;狂神说前端&lt;/a&gt;&lt;/li&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;li&gt;&lt;a&gt;狂神说Linux&lt;/a&gt;&lt;/li&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;li&gt;&lt;a&gt;狂神说大数据&lt;/a&gt;&lt;/li&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;li&gt;&lt;a&gt;狂神聊理财&lt;/a&gt;&lt;/li&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;/ul&gt;</font></div><div><font style="font-size: 16pt;">                        &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">            &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">        &lt;!-- 商品详情页面 --&gt;</font></div><div><font style="font-size: 16pt;">        &lt;div id=&quot;content&quot;&gt;</font></div><div><font style="font-size: 16pt;">            &lt;div class=&quot;main&quot;&gt;</font></div><div><font style="font-size: 16pt;">                &lt;!-- 品牌分类 --&gt;</font></div><div><font style="font-size: 16pt;">                &lt;form class=&quot;navAttrsForm&quot;&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;div class=&quot;attrs j_NavAttrs&quot; style=&quot;display:block&quot;&gt;</font></div><div><font style="font-size: 16pt;">                        &lt;div class=&quot;brandAttr j_nav_brand&quot;&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;div class=&quot;j_Brand attr&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;div class=&quot;attrKey&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                    品牌</font></div><div><font style="font-size: 16pt;">                                &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;div class=&quot;attrValues&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                    &lt;ul class=&quot;av-collapse row-2&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                        &lt;li&gt;&lt;a href=&quot;#&quot;&gt; 狂神说 &lt;/a&gt;&lt;/li&gt;</font></div><div><font style="font-size: 16pt;">                                        &lt;li&gt;&lt;a href=&quot;#&quot;&gt; Java &lt;/a&gt;&lt;/li&gt;</font></div><div><font style="font-size: 16pt;">                                    &lt;/ul&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                        &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                &lt;/form&gt;</font></div><div><font style="font-size: 16pt;">                &lt;!-- 排序规则 --&gt;</font></div><div><font style="font-size: 16pt;">                &lt;div class=&quot;filter clearfix&quot;&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;a class=&quot;fSort fSort-cur&quot;&gt;综合&lt;i class=&quot;f-ico-arrow-d&quot;&gt;&lt;/i&gt;&lt;/a&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;a class=&quot;fSort&quot;&gt;人气&lt;i class=&quot;f-ico-arrow-d&quot;&gt;&lt;/i&gt;&lt;/a&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;a class=&quot;fSort&quot;&gt;新品&lt;i class=&quot;f-ico-arrow-d&quot;&gt;&lt;/i&gt;&lt;/a&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;a class=&quot;fSort&quot;&gt;销量&lt;i class=&quot;f-ico-arrow-d&quot;&gt;&lt;/i&gt;&lt;/a&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;a class=&quot;fSort&quot;&gt;价格&lt;i class=&quot;f-ico-triangle-mt&quot;&gt;&lt;/i&gt;&lt;i class=&quot;f-ico-triangle-mb&quot;&gt;&lt;/i&gt;&lt;/a&gt;</font></div><div><font style="font-size: 16pt;">                &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                &lt;!-- 商品详情 --&gt;</font></div><div><font style="font-size: 16pt;">                &lt;div class=&quot;view grid-nosku&quot;&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;div class=&quot;product&quot; v-for=&quot;result in results&quot;&gt;</font></div><div><font style="font-size: 16pt;">                        &lt;div class=&quot;product-iWrap&quot;&gt;</font></div><div><font style="font-size: 16pt;">                            &amp;lt;!&amp;ndash;商品封面&amp;ndash;&amp;gt;</font></div><div><font style="font-size: 16pt;">                            &lt;div class=&quot;productImg-wrap&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;a class=&quot;productImg&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                    &lt;img :src=&quot;result.img&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;/a&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                            &amp;lt;!&amp;ndash;价格&amp;ndash;&amp;gt;</font></div><div><font style="font-size: 16pt;">                            &lt;p class=&quot;productPrice&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;em v-text=&quot;result.price&quot;&gt;&lt;/em&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;/p&gt;</font></div><div><font style="font-size: 16pt;">                            &amp;lt;!&amp;ndash;标题&amp;ndash;&amp;gt;</font></div><div><font style="font-size: 16pt;">                            &lt;p class=&quot;productTitle&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;a v-html=&quot;result.name&quot;&gt;&lt;/a&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;/p&gt;</font></div><div><font style="font-size: 16pt;">                            &amp;lt;!&amp;ndash; 店铺名 &amp;ndash;&amp;gt;</font></div><div><font style="font-size: 16pt;">                            &lt;div class=&quot;productShop&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;span v-text=&quot;result.shopnum&quot;&gt;&lt;/span&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                            &amp;lt;!&amp;ndash; 成交信息 &amp;ndash;&amp;gt;</font></div><div><font style="font-size: 16pt;">                            &lt;p class=&quot;productStatus&quot;&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;span&gt;月成交&lt;em&gt;999笔&lt;/em&gt;&lt;/span&gt;</font></div><div><font style="font-size: 16pt;">                                &lt;span&gt;评价 &lt;a&gt;3&lt;/a&gt;&lt;/span&gt;</font></div><div><font style="font-size: 16pt;">                            &lt;/p&gt;</font></div><div><font style="font-size: 16pt;">                        &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                    &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">                &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">            &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">        &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">    &lt;/div&gt;</font></div><div><font style="font-size: 16pt;">&lt;/div&gt;</font></div><div><font style="font-size: 16pt;">&lt;script src=&quot;https://unpkg.com/axios/dist/axios.min.js&quot;&gt;&lt;/script&gt;</font></div><div><font style="font-size: 16pt;">&lt;script src=&quot;https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js&quot;&gt;&lt;/script&gt;</font></div><div><font style="font-size: 16pt;">&lt;script&gt;</font></div><div><font style="font-size: 16pt;">    new Vue({</font></div><div><font style="font-size: 16pt;">        el: &quot;#app&quot;,</font></div><div><font style="font-size: 16pt;">        data: {</font></div><div><font style="font-size: 16pt;">            &quot;keyword&quot;: '', // 搜索的关键字</font></div><div><font style="font-size: 16pt;">            &quot;results&quot;: [] // 后端返回的结果</font></div><div><font style="font-size: 16pt;">        },</font></div><div><font style="font-size: 16pt;">        methods: {</font></div><div><font style="font-size: 16pt;">            searchKey() {</font></div><div><font style="font-size: 16pt;">                var keyword = this.keyword;</font></div><div><font style="font-size: 16pt;">                console.log(keyword);</font></div><div><font style="font-size: 16pt;">                axios.get('searchHighLight/' + keyword + '/0/20').then(response =&gt; {</font></div><div><font style="font-size: 16pt;">                    console.log(response);</font></div><div><font style="font-size: 16pt;">                    this.results = response.data;</font></div><div><font style="font-size: 16pt;">                })</font></div><div><font style="font-size: 16pt;">            }</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">    });</font></div><div><font style="font-size: 16pt;">&lt;/script&gt;</font></div><div><font style="font-size: 16pt;">&lt;/body&gt;</font></div><div><font style="font-size: 16pt;">&lt;/html&gt;</font></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; list-style: decimal; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></div><h5 style="box-sizing: border-box; padding: 0px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.4;">测试</span></span></h5><div style="text-align: center; box-sizing: border-box; padding: 0px; margin: 0px 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt;"><img src="./ElasticSearch/Image [70].png" type="image/png" data-filename="Image.png" width="1018"/></span></div><h1 style="box-sizing: border-box; padding: 0px 0px 0.3em; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-size: 16pt; color: rgb(102, 102, 102); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.2;">疑惑：</span></span></h1><h2 style="box-sizing: border-box; padding: 8px 10px; margin: 1em 0px 16px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: rgb(204, 229, 255); border-radius: 3px; position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: rgb(204, 229, 255); border-radius: 3px; position: relative; border-bottom: 1px solid rgb(238, 238, 238); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="background-color: rgb(204, 229, 255);"><span style="background-color: rgb(204, 229, 255);"><span style="background-color: rgb(204, 229, 255); font-size: 16pt; color: rgb(84, 88, 87); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; line-height: 1.425;">1、使用term（精确查询）时，我发现三个问题，问题如下：</span></span></span></span></h2><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">字段值必须是一个词（索引中存在的词），才能匹配</span></span></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">问题：中文字符串，term查询时无法查询到数据（比如，“编程”两字在文档中存在，但是搜索不到）</span></span></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">原因：索引为配置中文分词器（默认使用standard，即所有中文字符串都会被切分为单个中文汉字作为单词），所以没有超过1个汉字的词，也就无法匹配，进而查不到数据</span></span></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">解决：创建索引时配置中文分词器，如</span></span></div><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.15);-en-codeblock:true;"><div><font style="font-size: 16pt;">PUT example</font></div><div><font style="font-size: 16pt;">{</font></div><div><font style="font-size: 16pt;">    &quot;mappings&quot;: {</font></div><div><font style="font-size: 16pt;">    &quot;properties&quot;: {</font></div><div><font style="font-size: 16pt;">        &quot;name&quot;:{</font></div><div><font style="font-size: 16pt;">            &quot;type&quot;: &quot;text&quot;,</font></div><div><font style="font-size: 16pt;">        &quot;analyzer&quot;: &quot;ik_max_word&quot; // ik分词器</font></div><div><font style="font-size: 16pt;">            }</font></div><div><font style="font-size: 16pt;">        }</font></div><div><font style="font-size: 16pt;">    }</font></div><div><font style="font-size: 16pt;">}</font></div></div></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">查询的英文字符只能是小写，大写都无效</span></span></div></div><div style="box-sizing: border-box; padding: 0px; margin: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); list-style: initial !important;"><div style="box-sizing: border-box; padding: 0px; margin: 16px 0px; list-style: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span style="font-size: 16pt;">查询时英文单词必须是完整的</span></span></div></div><div><font style="font-size: 16pt;"><br/></font></div></div><hr/><div><br/></div></div></div><br/></div></span>
</div></body></html> 